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

Chart horizontal axis labels format

4 Answers 830 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chau
Top achievements
Rank 1
Chau asked on 03 Aug 2018, 01:50 PM

Is it possible to format the horizontal axis labels in percentage format (see attached screenshot)?

in .html file:
<kendo-chart-series>
                    <kendo-chart-series-item [data]="chartManagementObj.growthrevpatienttypeData" type="bar"
                                 [labels]="seriesLabels"
                                 field="revenue" categoryField="patienttype">
                    </kendo-chart-series-item>
 
in .ts file:
public seriesLabels: SeriesLabels = {
        visible: true, padding: 3, format: 'p2',
        font: 'bold 12px Arial, sans-serif'
    }

 

Thanks!

 

4 Answers, 1 is accepted

Sort by
0
Rebekah
Top achievements
Rank 1
answered on 06 Aug 2018, 02:26 PM

I think format has to be outside of SeriesLabels, second example in docs. 

<kendo-chart-series-item[data]="chartManagementObj.growthrevpatienttypeData" type="bar"
                                 [labels]="seriesLabels" format="p2"
                                 field="revenue" categoryField="patienttype">
                    </kendo-chart-series-item>

0
Chau
Top achievements
Rank 1
answered on 06 Aug 2018, 04:07 PM

Hi Rebekah,

I tried adding format='p2' as you suggested, but it still does not work.  The labels on the horizontal axis are not showing in percentage format.

<kendo-chart-series-item [data]="chartManagementObj.growthrevpatienttypeData" type="bar"
                                 [labels]="seriesLabels" format="p2"
                                 field="revenue" categoryField="patienttype">
</kendo-chart-series-item>
0
Accepted
Daniel
Telerik team
answered on 07 Aug 2018, 05:25 AM
Hello,

You should set the format to the value axis labels in order to format the horizontal axis of the bar chart - example.

Regards,
Daniel
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Chau
Top achievements
Rank 1
answered on 07 Aug 2018, 04:57 PM
Thanks Daniel, that works!
Tags
General Discussions
Asked by
Chau
Top achievements
Rank 1
Answers by
Rebekah
Top achievements
Rank 1
Chau
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or