Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Razor and MS ChartRazor and MS Chart
Previous
 
Next
New Post
8/19/2011 10:15 AM
 

I have created razor-script having following info
[start file]
<p><img src="graphStatic.cshtml" /> </p>
[end file]

I have created an addtional file, named 'graphStatic.cshtml', with following content:
[start file]
@{
    var myChart = new Chart(width: 600, height: 400)
           .AddTitle("Chart Title")
         .AddSeries(
             name: "Employee",
             xValue: new[] { "Peter", "Andrew", "Julie", "Mary", "Dave" },
             yValues: new[] { "2", "6", "4", "5", "3" })
         .Write();
 }
[end file]

If I use 'graphStatic.cshtml' as source for the razor-engine, an image is created, but it fills the screen...
I want the image to be displayed inside an image-tag, therefore the approach described above.

I have added the an image-handler and ref in the assemblies part of web config...
could the problem be collision between the telerik image handler and the ms chart image handler.

Thanks for any help!

 

 
New Post
8/21/2011 9:42 AM
 
that code looks fine to me, not sure why it's not working -perhaps the saving a chart as an image file code sample at http://www.asp.net/webmatrix/tutorials/7-displaying-data-in-a-chart might be more succesful.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/22/2011 6:50 AM
 
To save the image first to file was a good workaround!

myChart.Save(Server.MapPath(myurl)) is the way to go.

Thankyou for a very good and quick response!

Kr,
Aage.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Razor and MS ChartRazor and MS Chart


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out