Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#快速折线图_C#_Charts - Fatal编程技术网

C#快速折线图

C#快速折线图,c#,charts,C#,Charts,我很难用英语解释。 目前,我已经创建了下图所示的图表 使用此代码: public void CreateChart(DataTable chartTable ,string serieName) { var chartArea = new ChartArea(); chartArea.AxisX.LabelStyle.Format = "dd/MM/yyy"; chartArea.AxisX.MajorGrid.LineColor = Color.LightGray;

我很难用英语解释。 目前,我已经创建了下图所示的图表

使用此代码:

public void CreateChart(DataTable chartTable ,string serieName)
{

    var chartArea = new ChartArea();
    chartArea.AxisX.LabelStyle.Format = "dd/MM/yyy";
    chartArea.AxisX.MajorGrid.LineColor = Color.LightGray;
    chartArea.AxisY.MajorGrid.LineColor = Color.LightGray;
    chartArea.AxisX.LabelStyle.Font = new Font("Consolas", 6);
    chartArea.AxisY.LabelStyle.Font = new Font("Consolas", 6);
    chart1.ChartAreas.Add(chartArea);


    var series = new Series();
    series.Name = "TEMP_STACK_BOILER_1";
    series.ChartType = SeriesChartType.FastLine;
    series.XValueType = ChartValueType.DateTime;
    series.YValueType = ChartValueType.Double;
    chart1.Series.Add(series);



    int lastrow = chartTable.Rows.Count - 4;

    string[] xval = new string[lastrow];
    int[] yval = new int[lastrow];


    // bind the datapoints

    chart1.ChartAreas[0].AxisY.Maximum = 1000;
    chart1.ChartAreas[0].AxisY.Minimum = 0;

    for (int i = 0; i < lastrow; i++)
    {
        xval[i] =  chartTable.Rows[i][1].ToString() + "\r\n" +chartTable.Rows[i][0].ToString() ;
        yval[i] = Convert.ToInt32(chartTable.Rows[i][serieName]);           
    }

   chart1.Series[serieName].Points.DataBindXY(xval, yval);
   chart1.Invalidate();
}
public void CreateChart(DataTable chartTable,字符串序列号)
{
var chartArea=新的chartArea();
chartArea.axix.LabelStyle.Format=“dd/MM/yyy”;
chartArea.AxisX.MajorGrid.LineColor=Color.LightGray;
chartArea.AxisY.MajorGrid.LineColor=Color.LightGray;
chartArea.AxisX.LabelStyle.Font=新字体(“控制台”,6);
chartArea.AxisY.LabelStyle.Font=新字体(“控制台”,6);
chart1.ChartAreas.Add(chartArea);
var系列=新系列();
series.Name=“临时烟囱锅炉1”;
series.ChartType=serieChartType.FastLine;
series.XValueType=ChartValueType.DateTime;
series.YValueType=ChartValueType.Double;
图1.系列。添加(系列);
int lastrow=chartTable.Rows.Count-4;
字符串[]xval=新字符串[lastrow];
int[]yval=新int[lastrow];
//绑定数据点
chart1.ChartAreas[0]。AxisY.max=1000;
chart1.ChartAreas[0]。AxisY.Minimum=0;
对于(int i=0;i
但是我想显示Yvalue作为图片中的描述 我不知道它叫什么。(请看下图)

这是我想要的图表:

我试着在谷歌上搜索,但还是做不到。 我真的很抱歉我的英语不好


希望任何人都能帮助我。

您必须切换到
图表类型.Line

有若干:

快速折线图类型是以下折线图的变体: 显著缩短了包含图形的系列的绘图时间 大量的数据点。在以下情况下使用此图表: 使用非常大的数据集,渲染速度至关重要

快速折线图中省略了一些图表功能,以改进 演出省略的功能包括控制点级别 视觉属性、标记、数据点标签和阴影

这是为了保持绘图速度而设计的。除了性能和这些限制之外,它们是相同的,即它们看起来很相似

现在您可以设置

yourSeries.IsValueShownAsLabel = true;
对于整个
系列
选择一些值并将其值显示为
标签

yourSeries.Points[someIndex].IsValueShownAsLabel = true;

看一看非常感谢你,Mong Zhu