P
PRFerro
Hi all.
Is it possible to not show null (or zero/nothing) values on a chart? like
excel does.
Here is the code I'm using:
Dim xValues() As Object = {"Beverages", "Confections", _
"Dairy Products", "Grains & Cereals", _
"Meat & Poultry", "Seafood"}
Dim yValues1 As Object() = {104737, 85000, 75500}
'It's the same if I use something like this:
'Dim yValues1 As Object() = {104737, 85000, 75500, 0, Nothing, "#N/A"}
Dim yValues2 As Object() = {85000, 93000, 88500, 75000, 65000, 50000}
axGrafico.Charts(0).SeriesCollection.Add(0)
axGrafico.Charts(0).SeriesCollection(0).Caption = "Base"
axGrafico.Charts(0).SeriesCollection(0).SetData(Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimValues, -1, yValues1)
axGrafico.Charts(0).SeriesCollection(0).SetData(Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimCategories, -1, xValues)
axGrafico.Charts(0).SeriesCollection(0).Type =
Microsoft.Office.Interop.Owc11.ChartChartTypeEnum.chChartTypeLineStackedMarkers
axGrafico.Charts(0).SeriesCollection(0).Ungroup(False) 'Didn't work
axGrafico.Charts(0).SeriesCollection.Add(1)
axGrafico.Charts(0).SeriesCollection(1).Caption = "Comparativo"
axGrafico.Charts(0).SeriesCollection(1).SetData(Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimValues, -1, yValues2)
axGrafico.Charts(0).SeriesCollection(1).SetData(Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimCategories, -1, xValues)
axGrafico.Charts(0).SeriesCollection(1).Type =
Microsoft.Office.Interop.Owc11.ChartChartTypeEnum.chChartTypeLineStackedMarkers
I've created an image to ilustrate better what I'm trying to achive:
http://img515.imageshack.us/img515/6249/owc11.jpg
(the red circle is what I try to avoid).
Any help would be very appreciated, (and sorry for my english).
Pablo.
Is it possible to not show null (or zero/nothing) values on a chart? like
excel does.
Here is the code I'm using:
Dim xValues() As Object = {"Beverages", "Confections", _
"Dairy Products", "Grains & Cereals", _
"Meat & Poultry", "Seafood"}
Dim yValues1 As Object() = {104737, 85000, 75500}
'It's the same if I use something like this:
'Dim yValues1 As Object() = {104737, 85000, 75500, 0, Nothing, "#N/A"}
Dim yValues2 As Object() = {85000, 93000, 88500, 75000, 65000, 50000}
axGrafico.Charts(0).SeriesCollection.Add(0)
axGrafico.Charts(0).SeriesCollection(0).Caption = "Base"
axGrafico.Charts(0).SeriesCollection(0).SetData(Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimValues, -1, yValues1)
axGrafico.Charts(0).SeriesCollection(0).SetData(Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimCategories, -1, xValues)
axGrafico.Charts(0).SeriesCollection(0).Type =
Microsoft.Office.Interop.Owc11.ChartChartTypeEnum.chChartTypeLineStackedMarkers
axGrafico.Charts(0).SeriesCollection(0).Ungroup(False) 'Didn't work
axGrafico.Charts(0).SeriesCollection.Add(1)
axGrafico.Charts(0).SeriesCollection(1).Caption = "Comparativo"
axGrafico.Charts(0).SeriesCollection(1).SetData(Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimValues, -1, yValues2)
axGrafico.Charts(0).SeriesCollection(1).SetData(Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimCategories, -1, xValues)
axGrafico.Charts(0).SeriesCollection(1).Type =
Microsoft.Office.Interop.Owc11.ChartChartTypeEnum.chChartTypeLineStackedMarkers
I've created an image to ilustrate better what I'm trying to achive:
http://img515.imageshack.us/img515/6249/owc11.jpg
(the red circle is what I try to avoid).
Any help would be very appreciated, (and sorry for my english).
Pablo.