سؤال

I know that you can use keywords with labels, but is there any way to use a specific value from my data set as a label? What I would like to do is have a column of my data table contain a custom label string, so that each X-axis value graphed would have a unique label, but it seems there is no way to connect a series to an element from my data source. Is there a workaround to this, or will I just have to manually add labels over the chart?

هل كانت مفيدة؟

المحلول

I believe you are looking for setting a label for your datasource which is different from the columns which derive the X and Y values.In that case you can do this in the following manner

Chart1.Series[0].Points.DataBind(data, "XValue", "YValue", 
                               "ToolTip=mytooltip,Label=LabelColumnName");

Here you can specify the column name against Label which would be used to display the label, in the same fashion you could also set up the tooltip from a different property.

If this is not you are looking out then please update the question with more details.

EDIT

you can set the position of the label using CustomProperties of the series

Chart1.Series[0].CustomProperties = "LabelStyle=Left"; Check this

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top