BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Thanks for using Syncfusion products.
Generally, the chart component is registered and necessary scripts required by the chart are added in the layout file. When chart is loaded without registering the chart component and scripts required, chart image will be displayed but interactive features such as zooming, tooltip, etc., will not work without registering the scripts and it will cause script error.
Please refer the following code snippet to register the chart component and scripts required for chart:
<code>
[CSHTML]
@(Html.Syncfusion().StyleManager().Combine(true).Minify(true)
.Register(component =>
{
component.Add(ComponentType.Chart);
component.Add("~/Content/Site.css");
}))
@{Html.Syncfusion().ScriptManager().Combine(true).Minify(true).Render();}
</code>
Please download the modified sample attached to render chart without any script errors.
For printing the chart, please refer our online sample for printing the chart in the following link:
Please let us know if you have any concerns.
Regards,
Anandaraj
Since my
last message I bought the last version of essential studio ASP MVC (11.2.0.25)
and I’m still struggling to print a chart which was load from a JQuery call.
In my last
sample, loading the chart no longer causes an error nonetheless the print function
still not work
I know that
I’m using the chart in an unconventional way, but if you could take a look at
my example and explain why I can’t print, I would appreciate.
Thank you
for your time.
Just to
clarify, I am ‘Decker’, I use this account now because the license was bought
with it (company account).
Thanks
for your update.
Print
the chart image from the mvc model we suggest you to enable the “PrintButtonVisible”
property and now print image button will be display on chart control. When we
double click on that print image button the post action method will be call and
chart is export to print.
Please find
the below code snippet to achieve this.
[C#]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult
MyChart(MVCChartModel chartModel, ChartParams ChartParamsData)
{
chartModel = CreateModel(dateStart,
dateEnd);
ChartSeries series
= CreateSeries(dateStart, dateEnd);
chartModel.Series.Add(series);
chartModel.PrimaryXAxis.LabelIntersectAction = ChartLabelIntersectAction.Rotate;
return
chartModel.ChartActionResult(ChartParamsData);
}
For your convenience we have modified your sample’s
“ChartGeneratorController” file for print the chart image please download the file
from the below link.
For more
details regarding printing the chart image please refer our online document
link.
http://help.syncfusion.com/ug/asp.net%20mvc/chart/documents/printing.htm
Printing
the chart image using J-query (client side) we are validating this query and
will update you with further details in two business day (June/28/2013).
Please
let us know your concerns.
Thanks,
Bharathiraja
K.
Thank you for the help I didn’t realize the post action was necessary in order to print.
I read the documentation you mention, but I missed something:
When you need parameters from the client in order to generate a chart, how can you pass them to the print method?
For example in my demon what if I need this ?
public ActionResult MyChart(DateTime dateStart, DateTime dateEnd)
{ … }