Solved

How do I set PlotOptions in Highcharts using asp.net vb

Posted on 2015-01-20
3
420 Views
Last Modified: 2015-01-24
Using the Highchart.dll I can display graphs of data and set options for the axes and titles, but cannot find the code to set options for the plot area (eg background colour etc).

Can someone provide the code to set PlotOptions? My test page source is attached.
zztestHighchartSQL.aspx
0
Comment
Question by:slimguy
  • 2
3 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 40561313
Hi,
what .Net library are you using? Highcharts is normally "just" a Javascript library - so client side only. It seems that you are using an .NET wrapper - but which one? Without knowing your referenced 3rd party DLLs we cannot know which methods and properties they support.
I only found DotNet.Highcharts on Codeplex - but their namespace has a different signature (so that library has a SetPlotOptions method).

Thanks.
Rainer
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 40561332
Hi,
I think I found your referenced DLL - its Hightchart.NET on Codeplex :-)
As far as I can see, you have to create a new object
Hightchart.Core.Appearance
where you can set a lot of options (background, class, ...)
Dim myChartAppearance As Highchart.Core.Appearance
myChartAppearance = New Highchart.Core.Appearance()
myChartAppearance.backgroundColor = "#DDDDDD"
myChartAppearance.className = "csstest"

Open in new window

Then simply set the appearance on your chart object like
hcVendas.Appearance = myChartAppearance

Open in new window

HTH
Rainer
0
 

Author Closing Comment

by:slimguy
ID: 40568439
Thanks, that pointed me in the right direction. Sample code that I found to work is:

Dim myChartAppearance As Highchart.Core.Appearance.Appearance
        myChartAppearance = New Highchart.Core.Appearance.Appearance
        myChartAppearance.borderWidth = 5
        myChartAppearance.borderColor = "blue"
        myChartAppearance.borderRadius = 50
       
        hcVendas.Appearance = myChartAppearance
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now