Can I display a message if MS Chart Control has no data?

前端 未结 3 1821
情深已故
情深已故 2021-02-20 18:00

Is there a way to display a \"default\" message on a MS Chart Control if there is no data to chart?

I have a chart, with some controls that allow the user to pick variou

3条回答
  •  走了就别回头了
    2021-02-20 18:15

    I guess that you cast retrieved data to an Array and use it for chart binding, if so
    you can use a label, show/hide it according array length, as there is no property to be displayed a certain text if chart has no data.

        if (arr.Length > 0)
        {
            lblEmptyMSG.Visible = false;
        }
        else
        {
            lblEmptyMSG.Visible = true;
        }
    

提交回复
热议问题