Hello,
I have a Bar Chart and i wanted to put in the Y axis the values with the € simbol.
Is this posible?
Axis Legend
Re: Axis Legend
Hello Fulcrum,
I think you can use CustomLabels to add "€" in the Y axis, you can do something as next:
Thanks,
I think you can use CustomLabels to add "€" in the Y axis, you can do something as next:
Code: Select all
Steema.TeeChart.Styles.FastLine line1;
private void InitializeChart()
{
//Chart
tChart1.Aspect.View3D = false;
//Series
line1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
Random rnd = new Random();
for (int i = 0; i < 10; i++)
{
line1.Add(i, rnd.Next(10));
}
AddCustomLabels();
}
private void AddCustomLabels()
{
tChart1.Axes.Left.Labels.Items.Clear();
for (int i = 0; i < tChart1[0].Count; i++)
{
tChart1.Axes.Left.Labels.Items.Add(tChart1[0].YValues[i], (tChart1[0].YValues[i] + 1 + "€").ToString());
}
}
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Axis Legend
Thank for the code, it Works. But i want that the values of the axe that not always is the same as the bars to be with the €
Re: Axis Legend
Hello Fulcrum,
I suggest you two different alternative to achieve as you want:
First, changing labels valueFormat property as do in next lines of code:
Second, using GetAxisLabels event where you can add "€" for each labels as do in next code:
At any rate, we aren't sure as you want, therefore, we would be very grateful if my suggestion code, isn't as you want, explain exactly what are you want achieve. On the other hand, if is easier for you, explain your request in Spanish you can do it.
Thanks,
I suggest you two different alternative to achieve as you want:
First, changing labels valueFormat property as do in next lines of code:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.FastLine line1;
private void InitializeChart()
{
//Chart
tChart1.Aspect.View3D = false;
//Series
line1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
Random rnd = new Random();
for (int i = 0; i < 10; i )
{
line1.Add(i, rnd.Next(10));
}
tChart1.Axes.Left.Labels.ValueFormat = "0.#€";
}
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.FastLine line1;
private void InitializeChart()
{
//Chart
tChart1.Aspect.View3D = false;
//Series
line1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
Random rnd = new Random();
for (int i = 0; i < 10; i )
{
line1.Add(i, rnd.Next(10));
}
tChart1.GetAxisLabel = tChart1_GetAxisLabel;
}
void tChart1_GetAxisLabel(object sender, GetAxisLabelEventArgs e)
{
e.LabelText = e.LabelText "€";
}
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Axis Legend
thanks Sandra, the 1st solution made what I want