About

I'm Mike Pope. I live in the Seattle area. I've been a technical writer and editor for over 30 years. I'm interested in software, language, music, movies, books, motorcycles, travel, and ... well, lots of stuff.

Read more ...

Blog Search


(Supports AND)

Google Ads

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

I am not impressed by the Ivy League establishments. Of course they graduate the best—it's all they'll take, leaving to others the problem of educating the country. They will give you an education the way the banks will give you money—provided you can prove to their satisfaction that you don't need it.

— Peter DeVries



Navigation





<September 2023>
SMTWTFS
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

Categories

  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  

Contact Me

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 6/27/2023

Totals
Posts - 2648
Comments - 2662
Hits - 2,599,733

Averages
Entries/day - 0.36
Comments/entry - 1.01
Hits/day - 352

Updated every 30 minutes. Last: 7:04 AM Pacific


  11:22 PM

The ASP.NET Chart helper displays charts, as you can read in the chapter Displaying Data in a Chart:


For purposes of the Chart helper, you specify the chart type (bar, line, area, etc.) by passing the chartType parameter to the AddSeries method:

@{ 
var key = new Chart(width: 600, height: 400)
.AddTitle("Chart Title")
.AddSeries(
chartType: "Pie",
name: "Employee",
xValue: new[] { "Peter", "Andrew", "Julie", "Mary", "Dave" },
yValues: new[] { "2", "6", "4", "5", "3" })
.Write();
}
But this is just a string, so it's not clear what-all you can pass for the chartType value. Unless you happen to know that the Chart helper is actually a wrapper around the ASP.NET Chart control. If you know that, you can find the documentation for that dude (it's in a downloadable .chm file)[1] and learn that SeriesChartType enumeration supports the following:

Area
Bar
BoxPlot
Bubble
Candlestick
Column
Doughnut
ErrorBar
FastLine
FastPoint
Funnel
Kagi
Line
Pie
Point
PointAndFigure
Polar
Pyramid
Radar
Range
RangeBar
RangeColumn
Renko
Spline
SplineArea
SplineRange
StackedArea
StackedArea100
StackedBar
StackedBar100
StackedColumn
StackedColumn100
StepLine
Stock
ThreeLineBreak

I haven't tried all of them, but basically this is the list of names that you can pass, as strings, to the Chart helper in a Razor page. Actually sorting out what all these chart types are for and how they relate to your data series is, for the time being, left as an exercise for the reader.


[1] Or use the Object Browser in Visual Studio -- you're looking for System.Web.UI.DataVisualization.Charting.SeriesChartType.

[categories]   ,

|