About

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

Read more ...

Blog Search


(Supports AND)

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

[Creative writing can be taught] about the same way golf can be taught. A pro can point out obvious flaws in your swing.

Kurt Vonnegut



Navigation





<September 2024>
SMTWTFS
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

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 - 9/4/2024

Totals
Posts - 2655
Comments - 2677
Hits - 2,691,935

Averages
Entries/day - 0.34
Comments/entry - 1.01
Hits/day - 348

Updated every 30 minutes. Last: 5:56 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]   ,

|