K
Kyra
I never did get a satisfactory answer on this...
I am using OWC version 9. My chart type is
chChartTypeColumnStacked and I have multiple series. I
can turn on the Data Labels just fine for each series.
However, when the series value is zero, I get a bunch of
overlapping data labels that all say zero which I want to
either suppress or delete. The chart itself looks great.
Here is a more detailed explanation of the problem:
Let's say you have a chart where you are displaying how
many of the red, blue and green cars you see in the
parking lot each day. (I've inserted a crude drawing
below and some of my code.) You would have each date on
the x-axis, and the count from 0 to whatever on the y-
axis. Then you would have a series for red cars, a series
for blue cars, and a series for green cars. And let's
make the column color the same color as the car. The
problem is when you have zero cars at any time. For
example, today you had 5 blue cars, but no reds, and no
greens. Your chart column for today is completely blue
and fills up to the y-value of 5 -- that part is correct.
On my chart I also show the value of 5 inside the column
itself using data labels and that part is correct too.
Unfortunately, it also shows a data label of 0 for the red
and similarly a data label of 0 for the green. I don't
want the data label to show when the value is zero.
6+
|
5+ +-0-+ +---+
| |///| |*1*|
4+ |///| +---+
| |///| |///|
3+ |/5/| +-0-+ |/2/| \ - Red
| |///| |///| |///| / - Blue
2+ |///| |/2/| +---+ * - Green
| |///| |///| |\\\|
1+ |///| +---+ |\2\|
| |///| |\1\| |\\\|
0+--+-0-+--+---+--+---+
8/25 8/24 8/23
I don't want the 2 data labels of 0 on 8/25 (no red or
green cars) to show, nor the data label of 0 on 8/24 (no
green cars).
The applicable code I'm using for the data labels is:
ChartSpace.Charts(0).SetData c.chDimSeriesNames, 0, "Color"
ChartSpace.Charts(0).SetData c.chDimCategories, 0, "Date"
ChartSpace.Charts(0).SetData c.chDimValues, 0, "Count"
for i = 0 to ChartSpace.Charts(0).SeriesCollection.Count-1
ChartSpace.Charts(0).SeriesCollection
(i).DataLabelsCollection.Add
ChartSpace.Charts(0).SeriesCollection
(i).DataLabelsCollection(0).HasValue = True
ChartSpace.Charts(0).SeriesCollection
(i).DataLabelsCollection(0).Position =
c.chLabelPositionCenter
next
I am using OWC version 9. My chart type is
chChartTypeColumnStacked and I have multiple series. I
can turn on the Data Labels just fine for each series.
However, when the series value is zero, I get a bunch of
overlapping data labels that all say zero which I want to
either suppress or delete. The chart itself looks great.
Here is a more detailed explanation of the problem:
Let's say you have a chart where you are displaying how
many of the red, blue and green cars you see in the
parking lot each day. (I've inserted a crude drawing
below and some of my code.) You would have each date on
the x-axis, and the count from 0 to whatever on the y-
axis. Then you would have a series for red cars, a series
for blue cars, and a series for green cars. And let's
make the column color the same color as the car. The
problem is when you have zero cars at any time. For
example, today you had 5 blue cars, but no reds, and no
greens. Your chart column for today is completely blue
and fills up to the y-value of 5 -- that part is correct.
On my chart I also show the value of 5 inside the column
itself using data labels and that part is correct too.
Unfortunately, it also shows a data label of 0 for the red
and similarly a data label of 0 for the green. I don't
want the data label to show when the value is zero.
6+
|
5+ +-0-+ +---+
| |///| |*1*|
4+ |///| +---+
| |///| |///|
3+ |/5/| +-0-+ |/2/| \ - Red
| |///| |///| |///| / - Blue
2+ |///| |/2/| +---+ * - Green
| |///| |///| |\\\|
1+ |///| +---+ |\2\|
| |///| |\1\| |\\\|
0+--+-0-+--+---+--+---+
8/25 8/24 8/23
I don't want the 2 data labels of 0 on 8/25 (no red or
green cars) to show, nor the data label of 0 on 8/24 (no
green cars).
The applicable code I'm using for the data labels is:
ChartSpace.Charts(0).SetData c.chDimSeriesNames, 0, "Color"
ChartSpace.Charts(0).SetData c.chDimCategories, 0, "Date"
ChartSpace.Charts(0).SetData c.chDimValues, 0, "Count"
for i = 0 to ChartSpace.Charts(0).SeriesCollection.Count-1
ChartSpace.Charts(0).SeriesCollection
(i).DataLabelsCollection.Add
ChartSpace.Charts(0).SeriesCollection
(i).DataLabelsCollection(0).HasValue = True
ChartSpace.Charts(0).SeriesCollection
(i).DataLabelsCollection(0).Position =
c.chLabelPositionCenter
next