<series>  
           <asp:Series Name="Students" BorderColor="180, 26, 59, 105">  
            <Points>
                <asp:DataPoint AxisLabel="jon" XValue="5" YValues="4" />
                <asp:DataPoint AxisLabel="kon" XValue="15" YValues="44" />
                <asp:DataPoint AxisLabel="pol" XValue="85" YValues="90" />
            </Points>
           </asp:Series>  
           <asp:Series   Name="Teachers" BorderColor="180, 26, 59, 105">  
            <Points>
                <asp:DataPoint AxisLabel="hjim" XValue="50" YValues="40" />
                <asp:DataPoint AxisLabel="azdai" XValue="75" YValues="4" />
                <asp:DataPoint AxisLabel="kriasm" XValue="35" YValues="29" />
            </Points>
           </asp:Series>             
      </series> 

I want to change DataPoint's YValues in .cs file How can I do?

For example Series["Students"] --> DataPoint AxisLabel="jon" YValues="4" I want to change this value in .cs file

Member Avatar for LastMitch

I want to change DataPoint's YValues in .cs file How can I do?

Where is you datapoint code:

DataPoint dp = new DataPoint();

You need to make the adjustment in the XML file.

myXmlData = myXmlData.Replace("<DataPoint", "<asp:DataPoint");

<asp:Chart runat="server" Width="800" Height="800">

<asp:Series Name="Students" YValuesPerPoint="2" ChartType="" ChartArea="" Color="" BorderWidth="2" MarkerStyle="" MarkerBorderColor="">
<Points>
<asp:DataPoint AxisLabel="jon" XValue="5" YValues="4" />
<asp:DataPoint AxisLabel="kon" XValue="15" YValues="44" />
<asp:DataPoint AxisLabel="pol" XValue="85" YValues="90" />
</Points>
</asp:Series>

<asp:Series Name="Teachers" YValuesPerPoint="2" ChartType="" ChartArea="" Color="" BorderWidth="2" MarkerStyle="" MarkerBorderColor="">
<Points>
<asp:DataPoint AxisLabel="hjim" XValue="50" YValues="40" />
<asp:DataPoint AxisLabel="azdai" XValue="75" YValues="4" />
<asp:DataPoint AxisLabel="kriasm" XValue="35" YValues="29" />
</Points>
</asp:Series>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.