+
+
+
+
+
+"""
+install data-transport
+pip install data-transport[all]@git+https://github.com/lnyemba/data-transport
+"""
+import transport
+import pandas as pd
- // Clear previous chart instance if any
- if (window.myChart) window.myChart.destroy();
+# data-transport instance to read data
+#
+reader = transport.get.reader(label=':label')
+_args = :_query
- window.myChart = new Chart(ctx, {
- type: 'bar', // or 'line', 'pie', etc.
- data: {
- labels,
- datasets: [{
- label: 'Sales',
- data: values,
- backgroundColor: 'rgba(75, 192, 192, 0.5)',
- borderColor: 'rgba(75, 192, 192, 1)',
- borderWidth: 1
- }]
- },
- options: {
- responsive: true,
- scales: {
- y: {
- beginAtZero: true
- }
- }
- }
- });
- }
-
-
+# reading the query from ":label" into a pandas data-frame
+_df = reader.read(**_args)
+print(_df.head())
+
+
+