This component allows drawing various charts using the Chart.js library. It defines attributes for the chart data provider, title, legend, type, and handles events for initialization, data updates, and type changes.
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
12 views
Chartjs
This component allows drawing various charts using the Chart.js library. It defines attributes for the chart data provider, title, legend, type, and handles events for initialization, data updates, and type changes.
default="chartjsSampleLineChartDataProvider" required="true" description="Apex Class Name which provides JSON data to draw chart. As for JSON data format, two sample providers are available as chartjsSampleLineChartDataProvider and chartjsSamplePieChartDataProvider. Refer to http://www.chartjs.org/ for more details." /> <aura:attribute name="chartTitle" type="String" default="Chart Title" description="Title of the chart."/> <aura:attribute name="showLegend" type="Boolean" default="true" description="If set to false, legend does not show up. Defaut is true."/> <aura:attribute name="legendUnit" type="String" description="Unit for the legend."/> <aura:attribute name="chartType" type="String" description="Type of the chart. Available values are Line, Bar, Radar, Pie, Doughnut, PolarArea. If this is null, default chart type is automatically applied based on the data provided by apex data provider." /> <aura:attribute name="showChartTypeSwitch" type="Boolean" default="true" description="If set to false, chart type switch does not show up. Default is true." /> <aura:attribute name="componentName" type="String" description="Unique name of the component. Ex.This value will be used by ChartjsChartDataUpdate Event to specify which component should be affected. So this value should be unique amoung the application or component which this component belongs to." /> <aura:handler name="init" value="{!this}" action="{!c.doInit}" description="Initialization process." /> <aura:handler event="c:ChartjsChartTypeChange" action="{!c.changeChartType}" description="Triggered when chart type is changed." /> <aura:handler event="c:ChartjsChartDataUpdate" action="{!c.updateChart}" description="Triggered when chart data is updated. Event may include updated chart data." /> <aura:registerEvent name="ChartjsChartClick" type="c:ChartjsChartClick" description="Notify that certain segment of the chart is clicked." />