图表标记没有出现在行 [英] charting markers not appearing on line

查看:153
本文介绍了图表标记没有出现在行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我使用的是Windows窗体图表生成包含几行图形,可以创建图形上的一些混乱,需要一些东西来区分他们比其他颜色。有太多点使用点或虚线存在着和连续线之间没有可观察的差异。那么,我希望做的是让各种形状的标记显示在Excel中,如线,例如。现在我已经是编码像这样

So I'm using Windows Forms Chart to generate graphs containing several lines that can create some clutter on the graph and need something to differentiate them other than color. There are too many points to using dotted or dashed lines as there is no observable difference between that and a continuous line. So what I'm hoping to do is to get markers with various shapes to show up on the lines like in Excel, for instance. Right now I'm have it coded like this

myChart.Series["MySeries"].ChartType = SeriesChartType.FastLine;
myChart.Series["MySeries"].MarkerStyle = MarkerStyle.Diamond;



这样做是把钻石的传奇在该行,但它并没有把钻石实际行是图表本身英寸更改标记大小不有所作为,可惜的是,而且也不改变标记的颜色。有没有办法让这样的事情发生。 。感谢您的阅读,和你有任何帮助。

What this does is put a diamond in the legend over that line, but it doesn't put diamonds on the actual line that is in the chart itself. Changing the marker size doesn't make a difference, unfortunately, and neither does changing the marker color. Is there a way to get that to happen. Thanks for reading, and any help you have.

编辑:
继承人的相关代码。
它的数据是在一个类是一本字典的价值peice的举行。
类包含双打的名单。

Heres the relevant code. Its data is held in a class that is the value-peice of a dictionary. The class contains a list of doubles.

public void Charter(Color colorOfLine)
{
    double xValue;
    double yValue;

    myChart.Series.Add("MySeries");
    myChart.Series["MySeries"].ChartType.FastLine;
    myChart.Series["MySeries"].ChartArea = "ChartArea1";
    myChart.Series["MySeries"].Color = colorOfLine;

    myChart.Series["MySeries"].MarkerStyle = MarkerStyle.Diamond;
    myChart.Series["MySeries"].MarkerColor = Color.Black;
    myChart.Series["MySeries"].MarkerSize = 5;
    myChart.Series["MySeries"].MarkerBoarderColor = Color.DeepPink;

    foreach (KeyValuePair<int, MyClass> Pair in MyDictionary)
    {
        xValue = Pair.Value.MyClassList[0];
        yValue = Pair.Value.MyClassList[1];

        myChart.Series["MySeries"].Points.AddXY(xValue, yValue);
    }

}



我要补充一点,我已经与MarkerStep和MarkerBoarderWidth发挥各地为好,都没有任何好处。这个问题似乎是,标记根本没有出现在图表本身在实际线路。另外我使用Visual Studio 2010 Express的东西它的价值。阅读再次感谢。

I should add that I've played around with the MarkerStep, and MarkerBoarderWidth as well, all to no benefit. The issue seems to be that the marker simply isn't appearing on the actual lines in the chart itself. Also I'm using Visual Studio 2010 Express for what its worth. Thanks again for reading.

推荐答案

使用线路。不要使用快绳。快绳不会生成标记你。

Use Line. Don't use FastLine. FastLine won't generate markers for you.

myChart.Series["MySeries"].ChartType = SeriesChartType.Line 

这篇关于图表标记没有出现在行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆