Below is the similar code that I am using. The chart is generated on the
server side and shown as gif file on the client side. Sorry for the very late
response...
public partial class sample_cs_aspx : System.Web.UI.Page
{
protected void Page_Load()
{
ChartSpace objCSpace = new ChartSpaceClass ();
ChChart objChart = objCSpace.Charts.Add (0);
objChart.Type = ChartChartTypeEnum.chChartTypeLineMarkers;
// Enable events... not sure if these makes sense coz I am generating
chart in the server side
objCSpace.EnableEvents = true;
objCSpace.AllowRenderEvents = true;
objCSpace.AllowPointRenderEvents = true;
objChart.HasTitle = true;
objChart.Title.Caption = "Sample Chart";
objChart.HasLegend = true;
objChart.Legend.Border.DashStyle =
Microsoft.Office.Interop.Owc11.ChartLineDashStyleEnum.chLineDash;
objChart.Legend.Position =
Microsoft.Office.Interop.Owc11.ChartLegendPositionEnum.chLegendPositionRight;
string sCategory = "Jan,Feb,Mar,Apr";
int n = 0;
objChart.SeriesCollection.Add(n);
objChart.SeriesCollection[n].SetData(ChartDimensionsEnum.chDimSeriesNames,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, "Farm 1");
objChart.SeriesCollection[n].SetData(ChartDimensionsEnum.chDimCategories,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, sCategory);
objChart.SeriesCollection[n].SetData(ChartDimensionsEnum.chDimValues,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, "2,,1,5");
objCSpace.ExportPicture(Server.MapPath(".") + "\\.\\" + "sample.gif",
"GIF", 800, 300);
}
// What is the C# event handler for After render ?
// What is the C# event handler for Before render ?
}
vapor said:
AxChartspace = Windows client
Chartspace = Web client
I'm not sure why these options are not working for you. can I see some code?
--
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on
www.lulu.com/owc $19.99
vpdeguz said:
I am having problem with displaying line chart with null data point in
C#.NET
web page. I have tried several MSDN HOWTOs:
- HOW TO: Display Breaks for Null Data in an Office Web Component Line
Chart
- HOWTO: Use Custom Layout and Drawing with the Office Chart Component
- HOWTO: Advanced Custom drawing with the Office Web Components (OWC)
I think they are all client side. But I am looking for a fix in server
side.
Can you point me to a link or show a short code has BeforeRender and
AfterRender event handlers in aspx(server side)?
BTW, What is the difference between AxChartSpace and ChartSpace?
Thanks in advance,
vergel