Chart axis values with unit

Stimulsoft Reports.WPF discussion
Post Reply
stiuser
Posts: 12
Joined: Mon Oct 08, 2012 9:14 am

Chart axis values with unit

Post by stiuser »

Hi
I am using charts in my report. I need to display the unit with x axis and y axis values, like x axis values={100 cm, 200 cm, 300 cm} and y axis value={45kg, 23 kg, 85 kg}. Can anybody help me on this please?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Chart axis values with unit

Post by HighAley »

Hello.

Please, watch the How to Create Report with Charts videos on our site. http://www.stimulsoft.com/en/videos It will help you.
Let us know if you will need any additional help.

Thank you.
stiuser
Posts: 12
Joined: Mon Oct 08, 2012 9:14 am

Re: Chart axis values with unit

Post by stiuser »

Hi,
I have checked all the videos. But I didn't get a solution for my requirement. I need to set units for X-Axis and Y Axis values(value + some space + unit. E.g. 100 Kg).
I found that we can achieve this by setting the unit in Chart->properties->Area->Y- axis->Labels->Text After.

I have placed this chart in a data band. So we can expect more than one chart in a report. The units may differ from chart to chart. So I cannot set a fixed value to "Text After". I have the Unit column in Data source. But I don’t know how to bind this value to the Text After property. Please help me.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Chart axis values with unit

Post by HighAley »

Hello.

If you need to change the Text After property in each Chart which is on the Band then you could do it in the Before Print event of the Band with next code:

Code: Select all

this.Chart1_Area.YAxis.Labels.TextAfter = " " + Line;
Thank you.
Attachments
Report.mrt
(12.56 KiB) Downloaded 204 times
stiuser
Posts: 12
Joined: Mon Oct 08, 2012 9:14 am

Re: Chart axis values with unit

Post by stiuser »

Hi Aleksey,

Thank you very much for your reply. My issue solved.

Thank you very much.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Chart axis values with unit

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
Post Reply