Kk

Kk

  • NA
  • 20
  • 5.7k

It Possible export ajax line chart to spreedsheet in asp.net

Jul 25 2016 9:05 AM
In my application i have ajax control line chart but i need to export that ajax control line chart to excel(open office/Libra office). I tried html table export to excel but line chart is not export. Is It possible to Export ajax ToolKit control line chart to excel can any one help me out and can anyone give me suggestion how to do this.
 
aspx:
<cc1:LineChart ID="LineChart1" runat="server" ChartHeight="300" ChartWidth="900"
ChartType="Basic" ChartTitleColor="#0E426C" Visible="false" CategoryAxisLineColor="#D08AD9"
ValueAxisLineColor="#D08AD9" BaseLineColor="#A156AB">
</cc1:LineChart>
 
.cs code:
 
if (dt.Rows.Count >= 2)
{
string[] x = new string[dt.Rows.Count];
decimal[] y = new decimal[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
x[i] = dt.Rows[i][0].ToString();
y[i] = decimal.Parse(dtData2.Rows[i]["Accuracy"].ToString());
}
LineChart1.Series.Add(new AjaxControlToolkit.LineChartSeries { Data = y });
LineChart1.CategoriesAxis = string.Join(", ", x);
LineChart1.ChartTitle = "ABC";
LineChart1.Visible = true;
if (x.Length > 0)
{
LineChart1.ChartWidth = (x.Length * 180).ToString();
}
 
Thakyou

Answers (1)