Mitrahsoft
  • SERVICES
    • OUR SERVICES
      • SOFTWARE DEVELOPMENT
      • MOBILE DEVELOPMENT
      • BLOCKCHAIN DEVELOPMENT
      • SOFTWARE TESTING
      • CLOUD & DEVOPS SERVICES
      • PRODUCT DEVELOPMENT
      • OFFSHORE DEVELOPMENT
      • SOCIAL MEDIA MARKETING
      TECHNOLOGIES
      • COLDFUSION DEVELOPMENT
      • REACTJS DEVELOPMENT
      • VUEJS DEVELOPMENT
      • ANGULAR DEVELOPMENT
      • NODEJS DEVELOPMENT
      • PYTHON DEVELOPMENT
      • GOLANG DEVELOPMENT
      • GOLANG CORPORATE TRAINING
      COLDFUSION EXPERTISE
      • MURACMS EXPERTISE
      • COLDFUSION APP MIGRATION
      • COLDFUSION HOSTING & SUPPORT
      • CF LEGACY APP MAINTENANCE
      • COLDFUSION REST API
      • ECOMMERCE / SHOPPING CART SOLUTIONS
      • PRESIDECMS EXPERTISE
      MOBILE DEVELOPMENT
      • REACT NATIVE DEVELOPMENT
      • FLUTTER DEVELOPMENT
      • IONIC DEVELOPMENT
      • PHONEGAP DEVELOPMENT
  • ABOUT US
    • ABOUT MITRAHSOFT
    • OUR CLIENTS
    • TESTIMONIALS
    • PORTFOLIO
    • CAREERS
  • CONTACT US
  • BLOG
Adobe Solution PartnerLucee Solution Partner
Adobe Solution PartnerLucee Solution Partner
Adobe Solution PartnerLucee Solution Partner
  • OUR SERVICESSOFTWARE DEVELOPMENTMOBILE DEVELOPMENTBLOCKCHAIN DEVELOPMENTSOFTWARE TESTINGCLOUD & DEVOPS SERVICESPRODUCT DEVELOPMENTOFFSHORE DEVELOPMENTSOCIAL MEDIA MARKETING
    TECHNOLOGIESCOLDFUSION DEVELOPMENTREACTJS DEVELOPMENTVUEJS DEVELOPMENTANGULAR DEVELOPMENTNODEJS DEVELOPMENTPYTHON DEVELOPMENTGOLANG DEVELOPMENTGOLANG CORPORATE TRAINING
    COLDFUSION EXPERTISEMURACMS EXPERTISECOLDFUSION APP MIGRATIONCOLDFUSION HOSTING & SUPPORTCF LEGACY APP MAINTENANCECOLDFUSION REST API ECOMMERCE / SHOPPING CART SOLUTIONSPRESIDECMS EXPERTISE
    MOBILE DEVELOPMENTREACT NATIVE DEVELOPMENTFLUTTER DEVELOPMENTIONIC DEVELOPMENTPHONEGAP DEVELOPMENT
  • ABOUT MITRAHSOFTOUR CLIENTSTESTIMONIALSPORTFOLIOCAREERS
  • CONTACT US
  • BLOG

Charting Or Front End Data Visualization Using Echarts

HomeBlogCharting Or Front End Data Visualization Using Echarts
Echarts

Charting Or Front End Data Visualization Using Echarts

M
Post by MitrahsoftPublished: May 31, 2019

Data from back-end database shoule be displayed to the front-end in a visual way instead of just tabular format. Charting is a one of best data visualization technique. A chart is a graphical representation of data, in which "the data is represented by symbols, such as bars in a bar chart, lines in a line chart, or slices in a pie chart". A chart can represent tabular numeric data, functions or some kinds of qualitative structure and provides different info.

Charting Front End Data Visualization Using Echarts
ECharts is a set of front-end chart tool library originally developed by Baidu, Inc. Recently it was donated to apache foundation & it is open-sourced under Apache License 2.0. In this blog post, we are going to see how we are going to easily add echart charts to our web page.

Prerequisites

  1. To use ECharts, we must have to download the js file from the site and its accessible from here.
  2. After Download include the needed files to your page.
  3. Feed in the values and enjoy the report.
  4. This needs a div element to render the charts so need to be initialized like echarts.init(document.getElementById('lineChart'));

Here in the following we are going to see some samples charts and how to initialize them.

Sample Demo

At first we are going to see the demo of how the bar chart works with the Echart and what are the configs need to be done.

Bar Chart

Bar chart shows different data through the height of a bar, which is used in rectangular coordinate with at least 1 category axis.
Barchart Echart

html
// Need to declare a div to render the chart
<div id="barChart" style="width: 600px;height:400px;"></div>
<script>
	var myChart = echarts.init(document.getElementById('barChart'));

	var options = {
		color: ['#3398DB'],
		title: {
			text: 'Bar Chart'
		},
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'shadow'
			}
		},
		xAxis: {
			type: 'category',
			data: ['Tamil', 'English', 'Maths', 'Science', 'Social']
		},
		yAxis: {
			type: 'value'
		},
		series: [{
			data: [110, 150, 200, 80, 100],
			type: 'bar',
			label: {
				normal: {
					show: true,
					position: 'inside'
				}
			}
		}]
	};
	myChart.setOption(options);
</script>

Among the options very few are important, They are described below. These are the options which will be common for all chart type.

OptionObjectDescription
xAxisxAxis.type(Type of axis)The x axis in cartesian(rectangular) coordinate. Usually a single grid component can place at most 2 x axis, one on the bottom and another on the top. offset can be used to avoid overlap when you need to put more than two x axis. Default is 'category'.
xAxis.dataProvides the value range of the 'category' axis.
yAxisyAxis.type(Type of axis)The y axis in cartesian(rectangular) coordinate. Usually a single grid component can place at most 2 y axis, one on the left and another on the right. offset can be used to avoid overlap when you need to put more than two y axis. Default is 'value'.
yAxis.dataIf the data is not specified, it is auto collected from series.data
seriesseries[i].dataThe value that needs to be represented in the bar chart format.

Line Chart

Broken line chart relates all the data points symbol by broken lines, which is used to show the trend of data changing. It could be used in both rectangular coordinate and polar coordinate.
Line E Chart

html
// Need to declare a div to render the chart
<div id="lineChart" style="width: 600px;height:400px;"></div>

<script>
	var myChart = echarts.init(document.getElementById('lineChart'));

	var option = {
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'cross',
				label: {
					backgroundColor: '#6a7985'
				}
			}
		},
		xAxis: {
			type: 'category',
			boundaryGap: false,
			data: ['Tamil', 'English', 'Maths', 'Science', 'Social', 'Computer', 'Biology']
		},
		yAxis: {
			type: 'value'
		},
		series: [
			{
				name: 'Category Series',
				data: [700, 932, 901, 934, 1290, 1330, 1320],
				type: 'line',
				label: {
					normal: {
						show: true,
						position: 'top'
					}
				},
				areaStyle: {}
			}
		]
	};

	myChart.setOption(option);
</script>

Pie Chart

The pie chart is mainly used for showing proportion of different categories. Each arc length represents the proportion of data quantity.
Pie Chart E Chart

 

html
// Need to declare a div to render the chart
<div id="pieChart" style="width: 600px;height:400px;"></div>

<script>
	var myChart = echarts.init(document.getElementById('pieChart'));

	var option = {
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b}: {c} ({d}%)"
		},
		legend: {
			orient: 'vertical',
			left: 'left',
			data: ['Tamil', 'English', 'Maths', 'Science', 'Social']
		},
		series: [
			{
				name: 'piechart',
				type: 'pie',
				radius: '55%',
				avoidLabelOverlap: true,
				label: {
					normal: {
						show: true,
						position: 'left'
					},
					emphasis: {
						show: true,
						textStyle: {
							fontSize: '30',
							fontWeight: 'bold'
						},
						shadowBlur: 10,
						shadowOffsetX: 0,
						shadowColor: 'rgba(0, 0, 0, 0.5)'
					}
				},
				labelLine: {
					normal: {
						show: true
					}
				},
				data: [
					{ value: 335, name: 'Tamil' },
					{ value: 310, name: 'English' },
					{ value: 234, name: 'Maths' },
					{ value: 190, name: 'Science' },
					{ value: 700, name: 'Social' }
				]
			}
		]
	};

	myChart.setOption(option);
</script>

Tags

ADYENAMAZON-SESANDROIDAPACHEAPACHE-JMETERAWSBARCODE-SCANNERCOLDBOXCOLDFUSIONCOLDFUSION-API-INTEGRATIONCOLDFUSIONBUILDERECHARTSEVENT-GATEWAYFFMPEGFW1JQUERYJSOUPLUCEEMURACMSMURACMS-THEMENODEJSONESIGNALOSSPAYFLOW-PROPAYMENT-GATEWAYPAYPALPRESIDECMSPUPPETEERRAILORAZUNAREACTJSREACTNATIVERESTSASS-COMPILATIONSEMANTIC-UISUBLIMETEXTTINYMCETWILIOYUI-LIBRARY

Archives

JAN 20DEC 19AUG 19JUL 19JUN 19MAY 19APR 19MAR 19FEB 19JAN 19DEC 18NOV 18OCT 18MAR 16NOV 15SEP 15MAY 15MAY 14OCT 13JUN 13MAY 13APR 13MAR 13FEB 13JAN 13

Follow us

Mitrahsoft
United StatesUnited States

Hurst, Texas, United States

+1 (817) 606-8684usa-sales@mitrahsoft.com

IndiaIndia

Head Office

126G2/5, Thiru malai nagaram,
Kovilpatti - 628 501

Madurai

1/B, 2nd & 3rd floor, GV Complex,

Bye Pass Road, SS Colony,

Madurai - 625 016

Coimbatore

2nd Floor, Sri Narmadha Towers,

Murugan Nagar Rd, Thoppampatti Pirivu,

 K. Vadamadurai, Coimbatore - 641 017

+91 9092480924

business@mitrahsoft.com

ColdFusion
  • eCommerce / Shopping Cart Solutions
  • Payment Gateway Integrations
  • Shipping API Integrations
  • ColdFusion Development Services
  • REST API Development
  • MuraCMS Plugin Creation & Personalization
Technology Services
  • ReactJS Development
  • VueJS Development
  • AngularJS Development
  • NodeJS API Development
  • Python Development
  • Golang Development
  • React Native Development
  • D3.JS data Visualization
Other Services
  • Software Development
  • Mobile Development
  • Blockchain Development
  • Cloud & Devops Services

Connect with MitrahSoft

Please fill out this field
Please fill out this field
Please fill out this field
Please fill out this field
Please fill out this field
Please fill out this field

© 2026 All Rights Reserved. MitrahSoft Solutions Pvt Ltd

Home|About Us|Careers