This package provides Chart.js integration in to
cone.app
.
- Currently version v4.0.1 of
Chart.js
is included. - For building time and date based charts, Luxon v3.0.3 is included.
- For
Luxon
integration intoChart.js
, chartjs-adapter-luxon is required which is included in version v1.2.1.
The following cone.charts
related application configuration options are
available:
- cone.charts.luxon: Flag whether
Luxon
resources are delivered to browser. Defaults to false.
Some chart basic tiles are available in cone.charts
.
The following example shows how to implement a linechart:
from cone.charts.browser.chart import chart_tile
from cone.charts.browser.chart import LineChartTile
@chart_tile(
name='my_linechart',
interface=MyModel,
permission='view')
class MyLineChart(LineChartTile):
@staticmethod
def chart_data(model, request):
return {
'labels': ['Label 1', 'Label 2'],
'datasets': [{
'data': [10, 20],
'borderColor': 'rgb(255,0,0)',
'tension': 0.3,
'label': 'Dataset Label',
}],
}
Please refer to the source code in cone.charts.browser
package for
available chart tiles.
- Robert Niederreiter
- Torben Baumgartner
- Lena Daxenbichler