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

It's amazing how many early advancements in math were based on gambling. I guess it's sort of the same historical relationship between video technology and pornography. Not that there's anything wrong with that.

Jeff Atwood



Navigation





<June 2023>
SMTWTFS
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

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 - 5/22/2023

Totals
Posts - 2647
Comments - 2657
Hits - 2,570,306

Averages
Entries/day - 0.36
Comments/entry - 1.00
Hits/day - 353

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

|