Как скрыть маркировку точки данных, когда значение является нулем в StackedBar

Можно использовать Firephp дополнение для поджигателя для отладки php в той же среде как JavaScript.

я также использую Xdebug, упомянутый ранее для профилирования php.

7
задан Little JB 20 March 2009 в 17:48
поделиться

3 ответа

Вы можно скрыть метки в событии настройки:

protected void SummaryChart_Customize(object sender, EventArgs e)
{
    //hide label value if zero
    foreach (System.Web.UI.DataVisualization.Charting.Series series in SummaryChart.Series)
    {
        foreach (System.Web.UI.DataVisualization.Charting.DataPoint point in series.Points)
        {
            if (point.YValues.Length > 0 && (double)point.YValues.GetValue(0) == 0)
            {
                point.IsValueShownAsLabel = false;
            }
            else
            {
                point.IsValueShownAsLabel = true;
            }
        }
    }
}
5
ответ дан 6 December 2019 в 11:53
поделиться

Использовать собственный числовой формат, который подавляет нули, например

General ;;;

0,0% ;;;

$ #, ## 0,00 ;;;

2
ответ дан 6 December 2019 в 11:53
поделиться

I had the same problem and I solved it using the following number format

[=0]"";0.0%

The first part:

[=0]""

means that: if the value is equal to zero it should display an empty string

The second part:

0.0%

In this specific case means that all other values should be displayed as percent with one decimal. Any number format can be used as the second part.

[=0];General (Standard in some localized versions of Excel)

can be used to use default format.

Using VBA it would be:

Dim area as range
'The data area for the chart'
set area = Sheet1.range("A1:B3")
area.NumberFormat = "[=0];General"
0
ответ дан 6 December 2019 в 11:53
поделиться
Другие вопросы по тегам:

Похожие вопросы: