show distinct bars of stacked bar chart
show distinct bars of stacked bar chart
Hi i have a stacked bar chart and there are 11 bars with different colors stacked on each other. The problem is that there is no border between the bar sections, so its not easy to see distinguish the different bars as the colors to be used are not very distinct. i tried to put black border between them by-
Private Sub SetBarColor(ByVal aBar As Steema.TeeChart.Styles.Bar, ByVal aColor As Color)
aBar.Color = aColor
aBar.Pen.Color = Color.black
End Sub
but this does not give me black border line between 2 bars. I have uploaded attachment called screenshotBarcolor.doc for your reference.
Private Sub SetBarColor(ByVal aBar As Steema.TeeChart.Styles.Bar, ByVal aColor As Color)
aBar.Color = aColor
aBar.Pen.Color = Color.black
End Sub
but this does not give me black border line between 2 bars. I have uploaded attachment called screenshotBarcolor.doc for your reference.
Re: show distinct bars of stacked bar chart
Also i d using transparent color of Pen for all bars-
Private Sub SetBarColor(ByVal aBar As Steema.TeeChart.Styles.Bar, ByVal aColor As Color)
aBar.Color = aColor
aBar.Pen.Color = Color.Transparent
End Sub
but strangely it gives Pink line between the bars where bars have fill color of blue,light blue and Bue color between bars where bars have pink,orange kind of shades.Why is that? i am uploading another attchment called screenshotPencolorTransparent.doc for this one.
Private Sub SetBarColor(ByVal aBar As Steema.TeeChart.Styles.Bar, ByVal aColor As Color)
aBar.Color = aColor
aBar.Pen.Color = Color.Transparent
End Sub
but strangely it gives Pink line between the bars where bars have fill color of blue,light blue and Bue color between bars where bars have pink,orange kind of shades.Why is that? i am uploading another attchment called screenshotPencolorTransparent.doc for this one.
Re: show distinct bars of stacked bar chart
Hello shikha,
I couldn't reproduce it with last version 4 of TeeChart .Net and next code. Please, check if next code works as you want in your application.Hi i have a stacked bar chart and there are 11 bars with different colors stacked on each other. The problem is that there is no border between the bar sections, so its not easy to see distinguish the different bars as the colors to be used are not very distinct. i tried to put black border between them by-
Code: Select all
Private Sub InitializeChart()
tChart1.Dock = DockStyle.Fill
tChart1.Aspect.View3D = false
Dim i As Integer
For i=0 To 10
New Steema.TeeChart.Styles.Bar(tChart1.Chart)
tChart1(i).FillSampleValues
tChart1(i).Marks.Visible = false
CType(tChart1(i),Steema.TeeChart.Styles.Bar).Pen.Color = Color.Black
Next i
CType(tChart1(0),Steema.TeeChart.Styles.Bar).MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked
End Sub
I'm not sure which is your problem with previous code. Please, you could explain exactly what is your problem with Color.Transparent?Also i d using transparent color of Pen for all bars-
Private Sub SetBarColor(ByVal aBar As Steema.TeeChart.Styles.Bar, ByVal aColor As Color)
aBar.Color = aColor
aBar.Pen.Color = Color.Transparent
End Sub
Pen colours are automatically shaded (either darker or lighter) for aesthetic purposes. Please, see TeeChart .Net Demo concretely All Features\Welcome !\Chart styles\Standard\Barbut strangely it gives Pink line between the bars where bars have fill color of blue,light blue and Bue color between bars where bars have pink,orange kind of shades.Why is that?
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: show distinct bars of stacked bar chart
thanks, i figured out that my problem is due to fact that i am having some bars with value 0 , so they are showing up with a thin line in a chart giving a false impression that its due to pen.color or border of neigbour bar. So please let me know how can i remove the bars with 0 values from stacked bar, please guide with piece of code. many thanks.
Re: show distinct bars of stacked bar chart
Also i tried doing this i.e not to add the series if the value=0-
If Math.Round(dr("Series3"), 2) <> 0 Then
arBarSeries(IIABarSeries.DP).Add(dr("series3"))
End If
It solves this issue but gives another issue that in data table tool(Steema.TeeChart.Tools.DataTableTool associated with this chart) it does not display 0 , it shows blank!
If Math.Round(dr("Series3"), 2) <> 0 Then
arBarSeries(IIABarSeries.DP).Add(dr("series3"))
End If
It solves this issue but gives another issue that in data table tool(Steema.TeeChart.Tools.DataTableTool associated with this chart) it does not display 0 , it shows blank!
Re: show distinct bars of stacked bar chart
is there any way that the bars with 0 values are added to the data table( taht is they show 0 there) , but are not shown in the chart( currently they show up as a very thin line)
Re: show distinct bars of stacked bar chart
Hello shikha,
Thanks,
I could reproduce your problem, and I consider as a bug report with number [TF02014788]. We will try to fix it for next versions of TeeChart.Net.is there any way that the bars with 0 values are added to the data table( taht is they show 0 there) , but are not shown in the chart( currently they show up as a very thin line)
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: show distinct bars of stacked bar chart
Hi,
for 0 values you can use the "SetNull" method. I use it to avoid 0 value artefacts like you told.
for 0 values you can use the "SetNull" method. I use it to avoid 0 value artefacts like you told.
Re: show distinct bars of stacked bar chart
But then it would show blank/null in data table tool as well and so the purpose wont be solved. Or i misunderstood anything?
Re: show distinct bars of stacked bar chart
I don`t know how the datatable tool visualize the case if you first add a 0 value and then call SetNull for this point. Anyway, the bar is not shown as a small line
Re: show distinct bars of stacked bar chart
Thanks.. can you give me some example code( use of set null for this ) , it will really help..
Re: show distinct bars of stacked bar chart
for example like this:
Code: Select all
CustomBar cb = new CustomBar(tChart1.Chart);
cb.Add(0, 1);
cb.Add(1, 2);
cb.Add(2, 0);
cb.Add(3, 4);
cb.SetNull(2);
Re: show distinct bars of stacked bar chart
Hi shikha,
I think that there are two different problems here.
1. Stacked Bars with values = 0 are drawn as thick lines (TF02014788).
2. DataTableTool shows a blank space where it is a null point. I've added to the wish list the possibility to choose between showing or not the null points in the tool (TF02014789).
I think that there are two different problems here.
1. Stacked Bars with values = 0 are drawn as thick lines (TF02014788).
2. DataTableTool shows a blank space where it is a null point. I've added to the wish list the possibility to choose between showing or not the null points in the tool (TF02014789).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: show distinct bars of stacked bar chart
ok,thanks.