Appearance in Core Chart component
19 Dec 202424 minutes to read
Chart theme customization
You can customize the default theme of the chart theme
property. There are 9 themes available. They are, Material
, Fabric
, Bootstrap
, HighContrastLight
, MaterialDark
, FabricDark
, HighContrast
, BootstrapDark
and Bootstrap4
.
<ejs-chart id="container" title="Olympic Medals" theme="HighContrast">
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"></e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Custom color palette
You can customize the default color of series or points by providing a custom color palette of your choice by using the palettes
property.
@{
var palettes = new String[] { "#E94649", "#F6B53F", "#6FAAB0" };
}
<ejs-chart id="container" title="Olympic Medals" palettes="palettes">
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"></e-series>
<e-series dataSource="ViewBag.dataSource" name="Silver" xName="country" width="2" opacity="1" yName="silver" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"></e-series>
<e-series dataSource="ViewBag.dataSource" name="bronze" xName="country" width="2" opacity="1" yName="bronze" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"></e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
var palette = new string[] { "#E94649", "#F6B53F", "#6FAAB0" };
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50, silver=70, bronze=45 },
new ColumnChartData{ country="China", gold=40, silver= 60, bronze=55 },
new ColumnChartData{ country= "Japan", gold=70, silver= 60, bronze=50 },
new ColumnChartData{ country= "Australia", gold=60, silver= 56, bronze=40 },
new ColumnChartData{ country= "France", gold=50, silver= 45, bronze=35 },
new ColumnChartData{ country= "Germany", gold=40, silver=30, bronze=22 },
new ColumnChartData{ country= "Italy", gold=40, silver=35, bronze=37 },
new ColumnChartData{ country= "Sweden", gold=30, silver=25, bronze=27 }
};
ViewBag.dataSource = chartData;
ViewBag.palletes = palette;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
public double silver;
public double bronze;
}
Data point customization
The color of individual data point or data points within a range can be customized using the options below.
Point color mapping
You can bind the color for the points from dataSource
for the series using pointColorMapping
property.
<ejs-chart id="columnContainer" title="USA CLIMATE - WEATHER BY MONTH">
<e-chart-primaryxaxis valueType="Category">
<e-majorgridlines width="0"></e-majorgridlines>
</e-chart-primaryxaxis>
<e-chart-primaryyaxis labelFormat="{value}°C">
<e-majorticklines width="0"></e-majorticklines>
<e-minorticklines width="0"></e-minorticklines>
<e-linestyle width="0"></e-linestyle>
</e-chart-primaryyaxis>
<e-chart-chartarea>
<e-chartarea-border width="0"></e-chartarea-border>
</e-chart-chartarea>
<e-series-collection>
<e-series pointColorMapping="color" dataSource="ViewBag.dataSource" xName="x" yName="y" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
<e-series-cornerradius topLeft="10" topRight="10"></e-series-cornerradius>
</e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<RangeColorMappingData> chartData = new List<RangeColorMappingData>
{
new RangeColorMappingData { x= "Jan", y= 6.96, color= "red" },
new RangeColorMappingData { x= "Feb", y= 8.9, color = "blue" },
new RangeColorMappingData { x= "Mar", y= 12, color = "orange" },
new RangeColorMappingData { x= "Apr", y= 17.5, color = "aqua" },
new RangeColorMappingData { x= "May", y= 22.1, color = "grey" }
};
ViewBag.dataSource = chartData;
return View();
}
public class RangeColorMappingData
{
public string x;
public double y;
public string color;
}
Range color mapping
You can differentiate data points based on their y values using rangeColorSettings
in the chart.
<ejs-chart id="columnContainer" selectionMode="Point" title="USA CLIMATE - WEATHER BY MONTH">
<e-chart-primaryxaxis valueType="Category">
<e-majorgridlines width="0"></e-majorgridlines>
</e-chart-primaryxaxis>
<e-chart-primaryyaxis labelFormat="{value}°C">
<e-majorticklines width="0"></e-majorticklines>
<e-minorticklines width="0"></e-minorticklines>
<e-linestyle width="0"></e-linestyle>
</e-chart-primaryyaxis>
<e-chart-chartarea>
<e-chartarea-border width="0"></e-chartarea-border>
</e-chart-chartarea>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" yName="y" name="USA" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
<e-series-cornerradius topLeft="10" topRight="10"></e-series-cornerradius>
<e-series-animation enable="false"></e-series-animation>
<e-series-marker>
<e-series-datalabel visible="true" position="Outer">
</e-series-datalabel>
</e-series-marker>
</e-series>
</e-series-collection>
<e-chart-rangecolorsettings>
<e-chart-rangecolorsetting label="1°C to 10°C" start="1" end="10" colors="ViewBag.color1"></e-chart-rangecolorsetting>
<e-chart-rangecolorsetting label="11°C to 20°C" start="11" end="20" colors="ViewBag.color2"></e-chart-rangecolorsetting>
<e-chart-rangecolorsetting label="21°C to 30°C" start="21" end="30" colors="ViewBag.color3"></e-chart-rangecolorsetting>
</e-chart-rangecolorsettings>
<e-chart-tooltipsettings enable="false"></e-chart-tooltipsettings>
<e-chart-legendsettings mode="Range" visible="true" toggleVisibility="false"></e-chart-legendsettings>
</ejs-chart>
public IActionResult Index()
{
string[] color1 = { "#F9D422" };
string[] color2 = { "#F28F3F" };
string[] color3 = { "#E94F53" };
List<RangeColorMappingData> chartData = new List<RangeColorMappingData>
{
new RangeColorMappingData { x= "Jan", y= 6.96},
new RangeColorMappingData { x= "Feb", y= 8.9},
new RangeColorMappingData { x= "Mar", y= 12},
new RangeColorMappingData { x= "Apr", y= 17.5},
new RangeColorMappingData { x= "May", y= 22.1},
new RangeColorMappingData { x= "June", y= 25},
new RangeColorMappingData { x= "July", y= 29.4},
new RangeColorMappingData { x= "Aug", y= 29.6},
new RangeColorMappingData { x= "Sep", y= 25.8},
new RangeColorMappingData { x= "Oct", y= 21.1},
new RangeColorMappingData { x= "Nov", y= 15.5},
new RangeColorMappingData { x= "Dec", y= 9.9}
};
ViewBag.dataSource = chartData;
ViewBag.color1 = color1;
ViewBag.color2 = color2;
ViewBag.color3 = color3;
return View();
}
public class RangeColorMappingData
{
public string x;
public double y;
}
Point level customization
Marker, datalabel and fill color of each data point can be customized with pointRender
and textRender
event.
<ejs-chart id="container" title="Olympic Medals" pointRender="pointRender">
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"></e-series>
</e-series-collection>
</ejs-chart>
<script>
var colors = ['#00bdae', '#404041', '#357cd2', '#e56590', '#f8b883',
'#70ad47', '#dd8abd', '#7f84e8', '#7bb4eb', '#ea7a57'];
pointRender = function (args) {
args.fill = colors[args.point.index];
};
</script>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Chart area customization
Customize the chart background
Using background
and border
properties, you can change the background color and border of the chart.
<ejs-chart id="container" title="Olympic Medals" background="skyblue">
<e-chart-border width="2" color="#FF0000"></e-chart-border>
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"></e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Chart margin
You can set margin for chart from its container through margin
property.
<ejs-chart id="container" title="Olympic Medals" background="skyblue">
<e-chart-margin bottom="40" top="40" left="40" right="40"></e-chart-margin>
<e-chart-border width="2" color="#FF0000"></e-chart-border>
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"></e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Chart area customization
Using background
and border
properties, you can change the background color and border of the chart area. Width for the chart area can be customized using width
property.
<ejs-chart id="container" title="Olympic Medals">
<e-chart-chartarea background="skyblue" width="90%"></e-chart-chartarea>
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"></e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Chart area margin
You can customize the space between the chart area from its chart container through Margin
property.
<ejs-chart id="container" title="Olympic Medals">
<e-chart-chartarea>
<e-chart-border width="2" color="blue"></e-chart-border>
<e-margin top="50" bottom="50" left="50" right="50"></e-margin>
</e-chart-chartarea>
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"></e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Animation
You can customize animation for a particular series using animation
property. You can enable or disable animation of the series using enable
property, duration
specifies the duration of an animation and delay
allows us to start the animation at desire time.
<ejs-chart id="container" title="Olympic Medals">
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
<e-series-border width="3" color="red"></e-series-border>
<e-series-animation enable="true" duration="2000" delay="200"></e-series-animation>
</e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Fluid animation
Fluid animation used to animate series with updated dataSource continues animation rather than animation whole series. You can customize animation for a particular series using [animate
] method.
<ejs-chart id="container" loaded="window.onChartLoaded">
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" yName="y" name="Tiger" width=2 type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
<e-series-marker>
<e-series-datalabel visible="true" position="Top">
</e-series-datalabel>
</e-series-marker>
<e-series-cornerradius bottomLeft="10" bottomRight="10" topLeft="10" topRight="10"></e-series-cornerradius>
</e-series>
</e-series-collection>
</ejs-chart>
<script>
window.onChartLoaded = function (args) {
var count = 0;
args.chart.loaded = null;
setInterval(
function () {
if (count === 0) {
args.chart.series[0].dataSource = [
{ x: 'Egg', y: 206, text: 'Egg' },
{ x: 'Fish', y: 123, text: 'Fish' },
{ x: 'Misc', y: 48, text: 'Misc' },
{ x: 'Tea', y: 240, text: 'Tea' },
{ x: 'Fruits', y: 170, text: 'Fruits' }
];
args.chart.animate();
count++;
}
else if (count === 1) {
args.chart.series[0].dataSource = [
{ x: 'Egg', y: 206, text: 'Egg' },
{ x: 'Fish', y: 123, text: 'Fish' },
{ x: 'Misc', y: 48, text: 'Misc' },
{ x: 'Tea', y: 240, text: 'Tea' },
{ x: 'Fruits', y: 170, text: 'Fruits' }
];
args.chart.animate();
count++;
}
else if (count === 2) {
args.chart.series[0].dataSource = [
{ x: 'Egg', y: 206, text: 'Egg' },
{ x: 'Fish', y: 123, text: 'Fish' },
{ x: 'Misc', y: 48, text: 'Misc' },
{ x: 'Tea', y: 240, text: 'Tea' },
{ x: 'Fruits', y: 170, text: 'Fruits' }
];
args.chart.animate();
count = 0;
}
}, 2000);
}
</script>
public IActionResult Index()
{
List<RoundedColumnChartData> chartData = new List<RoundedColumnChartData>
{
new RoundedColumnChartData { x= "BGD", y= 106, text= "Bangaladesh" },
new RoundedColumnChartData { x= "BTN", y= 103, text= "Bhutn" },
new RoundedColumnChartData { x= "NPL", y= 198, text= "Nepal" },
new RoundedColumnChartData { x= "THA", y= 189, text= "Thiland" },
new RoundedColumnChartData { x= "MYS", y= 250, text= "Malaysia" }
};
ViewBag.dataSource = chartData;
ViewBag.font = new { fontWeight = "600", color = "#ffffff" };
return View();
}
public class RoundedColumnChartData
{
public string x;
public double y;
public string text;
}
Chart title
Chart can be given a title using title
property, to show the information about the data plotted.
<ejs-chart id="container" title="Olympic Medals">
<e-chart-titlestyle fontFamily="Arial" fontStyle="italic" fontWeight="regular" size="23px"
color="red"></e-chart-titlestyle>
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
</e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Title position
By using the Position
property in TitleStyle
, you can position the Title
at left, right, top or bottom of the chart. The title is positioned at the top of the chart, by default.
<ejs-chart id="container" title="Olympic Medal Counts - RIO">
<e-chart-titlestyle position="@Syncfusion.EJ2.Charts.TitlePosition.Bottom"></e-chart-titlestyle>
<e-chart-primaryxaxis valueType="Category" interval="1"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" yName="gold"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
</e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
The custom option helps you to position the title anywhere in the chart using X
and Y
coordinates.
<ejs-chart id="container" title="Olympic Medal Counts - RIO">
<e-chart-titlestyle position="@Syncfusion.EJ2.Charts.TitlePosition.Custom" x="300" y="60">
</e-chart-titlestyle>
<e-chart-primaryxaxis valueType="Category" interval="1"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" yName="gold"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
</e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Title alignment
You can align the title to the near, far, or center of the chart using the TextAlignment
property.
<ejs-chart id="container" title="Olympic Medal Counts - RIO">
<e-chart-titlestyle position="@Syncfusion.EJ2.Charts.TitlePosition.Bottom"
textAlignment="@Syncfusion.EJ2.Charts.Alignment.Far"></e-chart-titlestyle>
<e-chart-primaryxaxis valueType="Category" interval="1"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" yName="gold"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
</e-series>
</e-series-collection>
</ejs-chart>
public IActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}
Chart subTitle
Chart can be given a subtitle using subTitle
property, to show the information about the data plotted.
<ejs-chart id="container" title="Olympic Medal Counts - RIO" subTitle="(1975-2010)">
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" name="Gold" xName="country" width="2" opacity="1" yName="gold" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
</e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<ColumnChartData> chartData = new List<ColumnChartData>
{
new ColumnChartData{ country= "USA", gold=50 },
new ColumnChartData{ country="China", gold=40 },
new ColumnChartData{ country= "Japan", gold=70 },
new ColumnChartData{ country= "Australia", gold=60},
new ColumnChartData{ country= "France", gold=50 },
new ColumnChartData{ country= "Germany", gold=40 },
new ColumnChartData{ country= "Italy", gold=40 },
new ColumnChartData{ country= "Sweden", gold=30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ColumnChartData
{
public string country;
public double gold;
}