1

I am building my first own graph and im getting to what i need step by step. But i have a small problem that i can not figure out. My Line Chart shows data and when i hover with my mouse over the data points it shows the value. But there are no real points or circles on the data points in my chart and i can not seem to get them in the chart.

Here is my chart:

My Chart

As you can see, it is not clear where the datapoints are. Can anybode please help me figure out how to get circles on those points.

Here is my c# code:

protected void Button1_Click(object sender, EventArgs e)
    {
        con = new SqlConnection(@"Data Source=LP12;Initial Catalog=SmmsData;Integrated Security=True");
        cmd = new SqlCommand("Select DrukSensor,DateTime from SysteemSensorInfo2", con);
        da = new SqlDataAdapter(cmd);
        ds = new DataSet();
        da.Fill(ds);
        DataView source = new DataView(ds.Tables[0]);
        Chart1.DataSource = source;
        Chart1.Series[0].XValueMember = "DateTime";
        Chart1.Series[0].YValueMembers = "DrukSensor";
        Chart1.Series[0].BorderWidth = 3;
        Chart1.DataBind();
    }

And here is my html code:

          <asp:Chart ID="Chart1" runat="server" BackSecondaryColor="0, 0, 192" Palette="Pastel" Width="1026px">
        <series>
            <asp:Series ChartType="Line" Name="Series0" ToolTip="#VALY">
            </asp:Series>
        </series>
        <chartareas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </chartareas>
    </asp:Chart>

Thanks in advance!

Rico Brouwer
  • 81
  • 1
  • 12

1 Answers1

3

In addition to the normal way of displaying the DataPoints for a given ChartType, in your case as Lines, you often can also ask to display Markers:

enter image description here

 Chart1.Series[0].XValueMember = "DateTime";
 Chart1.Series[0].YValueMembers = "DrukSensor";
 Chart1.Series[0].BorderWidth = 3;
 Chart1.DataBind();

 Chart1.Series[0].MarkerColor = Color.Red;
 Chart1.Series[0].MarkerStyle = MarkerStyle.Circle;
 Chart1.Series[0].MarkerSize = 4;

You have a choice of several MarkerStyles including custom images; you can even create custom images dynamically.

Community
  • 1
  • 1
TaW
  • 53,122
  • 8
  • 69
  • 111