This is a migrated thread and some comments may be shown as answers.

Show series category names in a column chart [Kendo UI for Angular]

1 Answer 475 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 28 Apr 2017, 10:41 AM

Hi,

 

I'm trying to figure out how to display the category name for each data series on a column chart (I'm trying to get to something like the attached picture).

For now I'm just hard coding up an example in an html template. and so far I have the following:

<kendo-chart [categoryAxis]="{ categories: ['Assets', 'Liabilities']}">
    <kendo-chart-title text="Balance Sheet" font="22pt Segoe UI">
    </kendo-chart-title>
    <kendo-chart-series-defaults type="column" [labels]="{ visible: true }">
    </kendo-chart-series-defaults>
    <kendo-chart-legend [visible]="false"></kendo-chart-legend>
 
 
    <kendo-chart-series>
        <kendo-chart-series-item [stack]="true" [gap]="0.5" [data]="[60000, 0]" [name]="'Current Assets'">
        </kendo-chart-series-item>
        <kendo-chart-series-item  [name]="'Capital & Reserves'" [data]="[0, 20000]">
        </kendo-chart-series-item>
        <kendo-chart-series-item  [name]="'Current Liabilities'" [data]="[0, 40000]" >
        </kendo-chart-series-item>
    </kendo-chart-series>
</kendo-chart>

 

Looking at the docs (SeriesLabel) I think I can add more to the labels json object I'm configuring on line 4. But I'm struggling to get the syntax correct.

Does anyone have any suggestions?

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 02 May 2017, 06:27 AM
Hello,

You can use the content option for this purpose - example.

Regards,
Daniel
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Charts
Asked by
Simon
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or