问题描述
不管我怎么叫都没有显示,是不是有个什么属性?
解决方案
解决方案二:
chart1.Series[0].Name="A";chart2.Series[0].Name="B";chart2.Series[1].Name="C";List<data>list1=newList<data>();list1.AddRange(Enumerable.Range(1,30).Select(d=>newdata(){text=Guid.NewGuid().ToString().Substring(0,4),value=d}));List<data>list2=newList<data>();list2.AddRange(Enumerable.Range(1,30).Select(d=>newdata(){text=Guid.NewGuid().ToString().Substring(0,4),value=30-d}));chart1.Series[0].Points.DataBind(list1,"text","value","");chart1.Series[0].ToolTip="日期:#VALX\n油耗:#VAL";chart2.Series[0].Points.DataBind(list1,"text","value","");chart2.Series[1].Points.DataBind(list2,"text","value","");chart2.Series[0].ToolTip="日期:#VALX\n油耗:#VAL";chart2.Series[1].ToolTip="日期:#VALX\n油耗:#VAL";
上面的CS上的代码ToolTip就可以实现.
解决方案三:
BS很久没用了不太清楚不过好像一样吧是不是你某个属性没有设置好呢?
解决方案四:
Series["name不整确吧?"]....
解决方案五:
用Annotations注解集合试试//SetcharttitleTooltipscolorChart1.Annotations[0].ToolTip="IamaChartAnnotation!";orchart1.Series[0].ToolTip="Run1-MP:#VALX{F2}IRI:#VALY{G0}";希望能帮助你
解决方案六:
//AddseriestothechartSeriesseries=Chart1.Series.Add("Myseries");//Setseriesandlegendtooltipsseries.ToolTip="#VALX:#VAL{C}";已测试鼠标放上能显示series.LegendToolTip="#PERCENT";series.PostBackValue="#INDEX";series.LegendPostBackValue="#INDEX";//Populateseriesdatadouble[]yValues={65.62,75.54,60.45,34.73,85.42,32.12,55.18,67.15,56.24,23.65};string[]xValues={"France","Canada","Germany","USA","Italy","Russia","China","Japan","Sweden","Spain"};series.Points.DataBindXY(xValues,yValues);//Setseriesvisualattributesseries.ChartType=SeriesChartType.Bar;series.ShadowOffset=2;series.BorderColor=Color.DarkGray;series.CustomAttributes="LabelStyle=Outside";