How to hide the Values numbers in MultiSeries chart?

Coordinator
Mar 26, 2011 at 6:21 PM

There are two ways to not show the series values in MS charts.

1º You've defined in the code.

* So you only need to set ShowValues = false when creating a MSDataSet

 

	MSDataSet msDs;
	msDs = new MSDataSet("Eletronics", "ff0000") { ShowValues = false };
	msDs.SetElementSet.Add(new MSSetElement(15000));
	msDs.SetElementSet.Add(new MSSetElement(30000));
	oChart.DataSetList.Add(msDs);

 

2º You've set the chart's DataSource property.

* You have to call DataBind() method to parse the data and then set ShowValues = false of all MS created.

        // Set data   *DataTable OR IList<T>
        DataTable dtSample = GetSalesDataTable();
        oChart.DataSource = dtSample;
        oChart.DataCategoryTextField = "Month";
        oChart.DataSeriesTextField = "Brand";
        oChart.DataSeriesValueField = "Quantity";

        //**** Hide VALUES ****
        oChart.DataBind();
        oChart.DataSetList = oChart.DataSetList.Select(c => { c.ShowValues = false; return c; }).ToList();