I want to create drill down option for Kendo single bar chart in angular with a single data source. The parent class contain all data. for the parent chart as well as descendant (child, grand child charts). How I can do it?
component.html file
<kendo-chart [transitions]="false"> <kendo-chart-title [text]="singleBaChartData.singleBaChartData?.Title"></kendo-chart-title> <kendo-chart-series> <kendo-chart-series-item type="column" [data]="singleBaChartData.singleBaChartData?.singleBaChartData" categoryField="label" field="value" *ngIf="singleBaChartData" (initialized)="initialized($event)"> <kendo-chart-series-item-labels [align]="labelAlign" color="#000" [content]="labelContent"> </kendo-chart-series-item-labels> </kendo-chart-series-item> </kendo-chart-series> </kendo-chart>
Component.ts file
import { Component, OnInit } from '@angular/core'; import { Input } from '@angular/core'; @Component({ selector: 'app-single-bar-chart', templateUrl: './single-bar-chart.component.html', styleUrls: ['./single-bar-chart.component.css'] }) export class SingleBarChartComponent implements OnInit { @Input() singleBaChartData: any = []; ngOnInit() { } }
I am getting data using service file. This is the data set.
"singleBaChartData": { "name": "singleBaChartData-TOTAL REVENUE", "Title": "TOTAL REVENUE", "singleBaChartData": [ {"label": "Apple","value": "810000","link": "newchart-xml-apple"}, "linkeddata":[{ "id": "apple", "linkedchart": { "chart": { "caption": "Apple Juice - Quarterly Sales", "subcaption": "Last year", "numberprefix": "$", "theme": "fusion", "rotateValues": "0", "plottooltext": "$label, $dataValue, $percentValue" }, "data": [{"label": "Q1","value": "157000"}, {"label": "Q2","value": "172000"}, {"label": "Q3","value": "206000"}, {"label": "Q4","value": "275000"}] } }, ] },
.