本文介绍了如何在图表控件中打破一个系列线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

   在excel中,如果我想打破一个类型为 的系列,当系列值是某种类型时。我可以通过在excel表中添加一个空行来实现它,我希望系列被打破。我怎么能用asp.net
图表控件做同样的事情?

    In excel if I want to break a series which is of type Line when the series values are of certain type. I could do it by adding an empty row in the excel sheet where I want the series to be broken. How can I do the same with asp.net chart control?

搜索互联网后我发现我可以通过在系列中添加一个空数据点来做到这一点我想休息但我没有找到如何编写代码这样做。在将数据集绑定到
图表控件后,如何在需要时添加空数据点?

After searching the internet I found that I could do this by adding an empty data point to the series where I want a break but I did not find how to write code do this. How do I add an empty datapoint where needed after binding the dataset to the chart control?

请帮助

推荐答案

chart1.ChartAreas(" Default")。AxisY.ScaleBreakStyle.Enabled = True

chart1.ChartAreas(" Default" ).AxisY.ScaleBreakStyle.BreakLineStyle = BreakLineStyle.Wave

chart1.ChartAreas(" Default")。AxisY.ScaleBreakStyle.Spacing = 2 

chart1.ChartAreas(" ;默认")。AxisY.ScaleBreakStyle.LineWidth = 2

chart1.ChartAreas(" Default")。AxisY.ScaleBreakStyle.LineColor = Color.Red 

chart1。 ChartAreas(" Default")。AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold = 25 

chart1.ChartAreas(" Default")。AxisY.ScaleBreakStyle.IsStartedFromZero = AutoBool.Auto

chart1.ChartAreas("Default").AxisY.ScaleBreakStyle.Enabled = True
chart1.ChartAreas("Default").AxisY.ScaleBreakStyle.BreakLineStyle = BreakLineStyle.Wave
chart1.ChartAreas("Default").AxisY.ScaleBreakStyle.Spacing = 2 
chart1.ChartAreas("Default").AxisY.ScaleBreakStyle.LineWidth = 2
chart1.ChartAreas("Default").AxisY.ScaleBreakStyle.LineColor = Color.Red 
chart1.ChartAreas("Default").AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold = 25 
chart1.ChartAreas("Default").AxisY.ScaleBreakStyle.IsStartedFromZero = AutoBool.Auto

你可以使用任何一个而不是一个dding  一个空数据点。

You can use any of this instead of adding an empty datapoint.


这篇关于如何在图表控件中打破一个系列线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 16:02