ASP.NET Chart Setting Explicit Items
- Getting Started
- Setting Up ASP.NET Core MVC
- Accessibility
- Chart
- ASP.NET
- Overview
- Getting Started
- Design-time Support
- ItemTypes
- Chart Elements
- Chart Types
- Area Chart
- Bar Chart
- Bubble Chart
- Line Chart
- Pie Chart
- Sparklines
- Donut Chart
- Scatter Chart
- Spline Chart
- SplineArea Chart
- RangeArea Chart
- RangeBar Chart
- RangeSpline Chart
- StepLine Chart
- StepArea Chart
- PolarLine Chart
- PolarArea Chart
- PolarBar Chart
- PolarSpline Chart
- PolarSplineArea Chart
- PolarScatter Chart
- Combining Chart Types
- Data Binding
- Exporting
- Localization
- Selection
- Zooming and Panning
- Appearance and Styling
- Server Side Events
- Client Events
- Supported Browsers
- ASP.NET Core
- ASP.NET MVC
- JAVA Apache Wicket
- API
- allowUTCFormatting
- applyAnimation
- axisX
- axisTickText
- axisType
- categoricalValues
- decimalTicks
- drawColor
- drawWidth
- endOffset
- fixedEnd
- inverseOrder
- max
- min
- minorPlotStripColor
- minorPlotStripDashStyle
- minorPlotStripWidth
- minorTicksColor
- minorTicksHeight
- minorTicksRepeat
- minorTicksWidth
- offset
- plotBands
- plotLines
- plotStripColor
- plotStripDashStyle
- plotStripWidth
- startOffset
- swapLocation
- ticksColor
- ticksHeight
- ticksPlacement
- ticksRepeat
- ticksWidth
- title
- axisY
- axisTickText
- axisType
- decimalTicks
- drawColor
- drawWidth
- endOffset
- fixedEnd
- inverseOrder
- max
- min
- minorPlotStripColor
- minorPlotStripDashStyle
- minorPlotStripWidth
- minorTicksColor
- minorTicksHeight
- minorTicksRepeat
- minorTicksWidth
- offset
- plotBands
- plotLines
- plotStripColor
- plotStripDashStyle
- plotStripWidth
- startOffset
- swapLocation
- ticksColor
- ticksHeight
- ticksPlacement
- ticksRepeat
- ticksWidth
- title
- backgroundColor
- borderColor
- borderRadius
- borderWidth
- chartAreaBackgroundColor
- chartAreaBackgroundImage
- chartAreaBorderColor
- chartAreaBorderWidth
- chartAreaPaddingBottom
- chartAreaPaddingLeft
- chartAreaPaddingRight
- chartAreaPaddingTop
- chartLegend
- dataSeries
- enableAutoFit
- events
- exportOptions
- height
- isInverted
- margin
- primaryHeader
- secondaryHeader
- seriesPalette
- seriesSettings
- area
- bar
- bubble
- donut
- line
- pie
- polararea
- polarbar
- polarline
- polarscatter
- polarspline
- polarsplinearea
- rangearea
- rangebar
- rangesplinearea
- scatter
- spline
- splinearea
- steparea
- stepline
- seriesType
- theme
- tooltipSettings
- width
- zoomMode
- Getting Started
- Events
- How-To
- Methods
- Styling
- Supported Browsers
- ASP.NET
- Barcode
- QR Code
- TagCloud
- TreeMap
- Grid
- ASP.NET
- ASP.NET Core
- ASP.NET MVC
- JAVA Apache Wicket
- JavaScript
- API
- Settings
- altRowTemplate
- altRows
- columnReorder
- columns
- dataSource
- detailCollapseCssClass
- detailCollapseText
- detailExpandCollapse
- detailExpandCssClass
- detailExpandText
- detailTemplate
- editing
- exportOptions
- filtering
- grouping
- height
- maxHeight
- noRecordsTemplate
- noRecordsText
- paging
- resizing
- rowHover
- rowTemplate
- scrolling
- selection
- showHeader
- sorting
- toolbar
- Events
- Properties
- Methods
- addRow
- cancelEditing
- clearSelection
- collapseRow
- dataItem
- deleteRow
- destroy
- editCell
- editRow
- expandRow
- exportCsv
- exportExcel
- exportPdf
- filter
- hideColumn
- insertRow
- isHidden
- isLocked
- lockColumn
- page
- pageSize
- refresh
- reorderColumn
- revertChanges
- saveChanges
- scrollTop
- select
- selectedRowIndices
- showColumn
- sort
- ungroup
- unlockColumn
- Settings
- Getting Started
- Autogenerated Editors
- Binding to Data
- Cancel User Iteraction
- Change Options Dynamically
- Columns
- Custom Editors
- Exporting
- Filtering
- Footer Total Aggregates
- Grouping
- Hierarchy
- Paging
- RTL
- Scrolling
- Selection
- Sorting
- Templates
- Themes
- Validation
- API
- Accordion
- AutoComplete
- Button
- Calendar
- CheckBox
- ColorPicker
- ComboBox
- ContextMenu
- DataSource
- DatePicker
- DateTimePicker
- Draggable
- DropDown
- Droppable
- Editor
- ListBox
- LoadingPanel
- MaskedTextBox
- Menu
- MonthYearPicker
- NumericTextBox
- Pager
- ProgressBar
- RadioButton
- Rating
- RecursiveDataSource
- Slider
- SplitButton
- Splitter
- Switch
- Tabs
- TextBox
- TimePicker
- Timeline
- Tooltip
- TreeView
- Upload
- Window
The data that will be displayed in the ShieldChart can be declared explicitly in several ways:
- Declarative Creation- Setting items in the markup (statically) using the Items collection of each series.
<shield:ShieldChart ID="ShieldChart1" Width="100%" Height="400px" runat="server" CssClass="chart"> <DataSeries> <shield:ChartBarSeries> <Items> <shield:ChartSeriesItem ValueY="1" ValueX="1" /> <shield:ChartSeriesItem ValueY="2" ValueX="2" /> <shield:ChartSeriesItem ValueY="3" ValueX="3" Color="Green" /> <shield:ChartSeriesItem ValueY="4" ValueX="4" /> <shield:ChartSeriesItem ValueY="5" ValueX="5" /> </Items> </shield:ChartBarSeries> </DataSeries> </shield:ShieldChart>
- Programmatic Creation -
SeriesItems
can be created on the server like any other objects, then added to the Items collection of the desired series.
protected override void OnLoad(EventArgs e) { base.OnLoad(e); ChartBarSeries barSeries = ShieldChart1.DataSeries[0] as ChartBarSeries; ChartSeriesItem item = new ChartSeriesItem(); item.ValueY = 1; item.ValueX = 1; barSeries.Items.Add(item); item = new ChartSeriesItem(); item.ValueY = 2; item.ValueX = 2; barSeries.Items.Add(item); item = new ChartSeriesItem(); item.ValueY = 3; item.ValueX = 3; item.Color = Color.Green; barSeries.Items.Add(item); item = new ChartSeriesItem(); item.ValueY = 4; item.ValueX = 4; barSeries.Items.Add(item); item = new ChartSeriesItem(); item.ValueY = 5; item.ValueX = 5; barSeries.Items.Add(item); }
Example of programmatic chart creation can be found on the Programmatic Creationdemo.
- Declarative and Programmatic Creation - Series items can be created programmatically and then added to an existing series items collection that is set in the markup. Series items set in the markup can also be accessed and modified from the code behind.
NOTE: If the chart has both explicit items and it is data bound to a specific data source in order to append explicitly added items you need to setShieldChart.AppendDataBoundItems
to
"true"
.
<shield:ShieldChart ID="ShieldChart1" Width="100%" Height="400px" runat="server" CssClass="chart" AppendDataBoundItems="true"> …
Example of adding declarative items can be found on the Append Databound Itemsdemo.