Nativescript-ui-feedback: Chart Label Format

Created on 12 Apr 2017  路  2Comments  路  Source: ProgressNS/nativescript-ui-feedback

Hi,
How can I printout linear aixvalues and label values of chart object formatted?

The value I see : 12500.00 but I want it as 12.500

Thank you.

chart question

Most helpful comment

Hello @initialcatalog ,

For the axis labels you can use axis.labelFormat = "%.3f"
http://testdocs.telerik.com/devtools/nativescript-ui/api/classes/linearaxis.html#labelformat

for the series labels you can set _textFormat_ to the _PointLabelStyle_
http://testdocs.telerik.com/devtools/nativescript-ui/api/classes/pointlabelstyle.html#textformat
e.g.

        <chart:RadCartesianChart.series>
            <chart:BarSeries showLabels="true" items="{{ sourceItems1 }}" categoryProperty="{{ categoryProperty1 }}" valueProperty="{{ valuePropertySales1 }}">
                 <chart:BarSeries.labelStyle>
                     <chart:PointLabelStyle margin="10" fillColor="Green" textFormat="%.3f"/>
                 </chart:BarSeries.labelStyle>
            </chart:BarSeries>
        </chart:RadCartesianChart.series>

All 2 comments

Hello @initialcatalog ,

For the axis labels you can use axis.labelFormat = "%.3f"
http://testdocs.telerik.com/devtools/nativescript-ui/api/classes/linearaxis.html#labelformat

for the series labels you can set _textFormat_ to the _PointLabelStyle_
http://testdocs.telerik.com/devtools/nativescript-ui/api/classes/pointlabelstyle.html#textformat
e.g.

        <chart:RadCartesianChart.series>
            <chart:BarSeries showLabels="true" items="{{ sourceItems1 }}" categoryProperty="{{ categoryProperty1 }}" valueProperty="{{ valuePropertySales1 }}">
                 <chart:BarSeries.labelStyle>
                     <chart:PointLabelStyle margin="10" fillColor="Green" textFormat="%.3f"/>
                 </chart:BarSeries.labelStyle>
            </chart:BarSeries>
        </chart:RadCartesianChart.series>

@Natalia-Hristova Thank you for reply.

Was this page helpful?
0 / 5 - 0 ratings