asp.net mvc - convert list<int> to object -


i trying create chart in mvc highchart can see chart:

  highcharts chart = new highcharts("chart1")                       .setxaxis(new xaxis { categories = "one"})                       .setyaxis(new yaxis { title = new yaxistitle { text = "تعداد مقالات" } })                       .setseries(new series { data = new data(new object[] {312}), name = "محور های همایش" })                       .settitle(new title { text = "" })                       .initchart(new chart { defaultseriestype = charttypes.column }); 

the problem here :

data = new data(new object[] {312}) 

instead 312 want pass list<int> contains 312 can see here:

list<int> majorarticlecount=new list<int>(); data = new data(new object[] {majorarticlecount}) 

this list majorarticlecount contains 312 error :

 parameter count mismatch.  

how can convert list object ?

i'm not sure data might try this:

list<int> majorarticlecount = new list<int>();  majorarticlecount.add(312);  data = new data(new object[] { majorarticlecount.toarray()}); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -