Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello I am using ASP.Net 2.0 charting control and in local machine if i run am getting graph and also not creating any files into my folder. when I run the same from server am getting the graph and also image of chart is being generated in the root folder of the server. How to avoid creating files in server.

Below is my pages both .aspx and .cs

---.aspx page contains

XML
<asp:Chart ID="Chart1" runat="server" Width="950">
                    <Series>
                        <asp:Series Name="Series1">
                        </asp:Series>
                        <asp:Series Name="Series2">
                        </asp:Series>
                    </Series>
                    <ChartAreas>
                        <asp:ChartArea Name="ChartArea1">
                        </asp:ChartArea>
                    </ChartAreas>
                </asp:Chart>



and my .cs file contains

In page load am calling

C#
protected void Page_Load(object sender, EventArgs e)
   {


C#
this.Chart1.DataSource = list;
        ConfigureChart();
    }



C#
private void ConfigureChart()
    {
        Chart1.Titles.Add(new Title("Amount Collection Graph"));
        ConfigurTitle(Chart1.Titles[0]);
        ConfigureArea(Chart1.ChartAreas[0]);
        ConfigureSeries(Chart1.Series[0], "X", "Y1");
        Chart1.Series[1].ChartArea = Chart1.ChartAreas[0].Name;
    }
    private void ConfigureArea(ChartArea area)
    {
        //configure Chart Areas:
        area.ShadowColor = Color.Gray;
        area.ShadowOffset = 10;
        area.AxisY.Title = "Amount in Rs.";
        area.AxisX.Title = "Day's";
        area.AxisX.IsMarginVisible = true;
        area.Area3DStyle.Enable3D = display3d;
    }
    private void ConfigurTitle(Title title)
    {
        //configure Title:
        title.BorderColor = Color.Silver;
        title.BorderDashStyle = ChartDashStyle.Solid;
        title.ShadowColor = Color.Gray;
        title.ShadowOffset = 6;
        title.Font = new Font(FontFamily.GenericSansSerif, (float)13);
        title.IsDockedInsideChartArea = true;
    }
    private void ConfigureSeries(Series series, string xValue, string vValue)
    {
        //configure Series:
        series.XValueMember = xValue;
        //series
        //series["ShowMarkerLines"] = "True";
        series.YValueMembers = vValue;
        series.MarkerStyle = MarkerStyle.Square;
        series.IsValueShownAsLabel = showValues;
        series.Color = System.Drawing.Color.DodgerBlue;
        series.BorderColor = System.Drawing.Color.Blue;
        //series.XAxisType = AxisType.Secondary;
        series.ChartType = SeriesChartType.Line;
    }
Posted

1 solution

You can't. That's the way the chart control works. HTMLK has no way of generating/displaying the chart as it is renedered, so an image is created, and then displayed to the user. If you want real chart rendering, you have to move to one of the RIA technologies, like Flex, Fusion, or Silverlight.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900