Bar Chart. Changing the Legend Display
Posted: Tue Jul 14, 2015 4:09 pm
Hi, Please see the attached bar chart screenshot. Its a basic bar chart. Ive attached the code below that I used to create it.
Id like to change the display in the following ways;
1) The legend simply display "bar1". Instead Id like to have a legend that displays the value of each bar. eg.
SYNC = 23333
CFD = 2323
TAC = 12122
ADC = 568768
Is this possible?
2) The Y-axis exponential labelling is almost OK. However instead of "1.0*10+7" Id like to just have "10+7".
ie. How do I remove the preceding "1.0". Ive tried changing the ValueFormat for the left axis label but I am not getting what I want.
3) Finally how do I make the bars be closer together?
Thanks.
Dave
--------------------------------------------------------------------
ratesChart.Aspect.View3D = false;
ratesChart.Axes.Left.Labels.Exponent = true;
ratesChart.Axes.Left.Labels.ValueFormat = "#.0•10 E+0";
ratesChart.Axes.Left.Logarithmic = true;
ratesChart.Legend.Visible = true;
bar1 = new Steema.TeeChart.Styles.Bar(ratesChart.Chart);
int sync = 50000;
int cfd = 60000;
int tac = 55000;
int adc = 44000;
bar1.Add(sync, "SYNC", Color.Green);
bar1.Add(cfd, "CFD", Color.Black);
bar1.Add(tac, "TAC", Color.Blue);
bar1.Add(adc, "ADC", Color.Red);
bar1.Marks.Visible = false;
bar1.BarWidthPercent = 30;
Id like to change the display in the following ways;
1) The legend simply display "bar1". Instead Id like to have a legend that displays the value of each bar. eg.
SYNC = 23333
CFD = 2323
TAC = 12122
ADC = 568768
Is this possible?
2) The Y-axis exponential labelling is almost OK. However instead of "1.0*10+7" Id like to just have "10+7".
ie. How do I remove the preceding "1.0". Ive tried changing the ValueFormat for the left axis label but I am not getting what I want.
3) Finally how do I make the bars be closer together?
Thanks.
Dave
--------------------------------------------------------------------
ratesChart.Aspect.View3D = false;
ratesChart.Axes.Left.Labels.Exponent = true;
ratesChart.Axes.Left.Labels.ValueFormat = "#.0•10 E+0";
ratesChart.Axes.Left.Logarithmic = true;
ratesChart.Legend.Visible = true;
bar1 = new Steema.TeeChart.Styles.Bar(ratesChart.Chart);
int sync = 50000;
int cfd = 60000;
int tac = 55000;
int adc = 44000;
bar1.Add(sync, "SYNC", Color.Green);
bar1.Add(cfd, "CFD", Color.Black);
bar1.Add(tac, "TAC", Color.Blue);
bar1.Add(adc, "ADC", Color.Red);
bar1.Marks.Visible = false;
bar1.BarWidthPercent = 30;