Lolipop Chart using JQuery
Introduction: Hello Guys, “Welcome back” Today, i am here with another one new great article. In this article I explained about the implementation of funny named Lolipop Chart using JQuery. In this article I am using the concept of High Charts. For more information you can visit website of High Chart
Implementation: In this article, I am giving example of Result of Top 10 Schools of India in year 2024. In this chart i am showing Result in % for all the schools of India. You can see school name with the result in this chart. In this article I am giving static data but you can create it dynamically by using the values of Database. For creating it dynamically you need to create the for loop at the time of passing parameters as values to the program. You can check in my list of articles. In last article I already created chart concept with dynamically data from database. Here I am using for loop. And in the below mentioned article I am passing the values dynamically from the database. You can create area chart dynamically too by following this link. You need to create the for loop to pass the parameters to the chart same created as in below mentioned link
https://usingaspdotnet.blogspot.com/2011/07/visualization-pie-chart-in-aspnet.html
Now here i am writing the complete code of the HTML page. You can copy the whole code and paste the whole code at your HTML page. It’s really too much great concept.
<!DOCTYPE HTML>
<html>
<head>
<title>Highcharts Example</title>
<style type="text/css">
* {
font-family:
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Helvetica,
Arial,
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol",
sans-serif;
}
.highcharts-figure {
min-width: 320px;
max-width: 800px;
margin: 1em auto;
}
.ld-label {
width: 200px;
display: inline-block;
}
.ld-url-input {
width: 500px;
}
.ld-time-input {
width: 40px;
}
.highcharts-description {
margin: 0.3rem 10px;
}
@media (prefers-color-scheme: dark) {
body {
background-color: #141414;
color: #ddd;
}
a {
color: #2caffe;
}
}
</style>
</head>
<body>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/dumbbell.js"></script>
<script src="https://code.highcharts.com/modules/lollipop.js"></script>
<figure class="highcharts-figure">
<div id="container"></div>
<p class="highcharts-description">
Lollipop charts </p>
</figure>
<script type="text/javascript">
Highcharts.chart('container', {
chart: {
type: 'lollipop'
},
accessibility: {
point: {
valueDescriptionFormat: '{index}. {xDescription}, {point.y}.'
}
},
legend: {
enabled: false
},
subtitle: {
text: '2024'
},
title: {
text: 'Result of Top 10 Schools of India'
},
tooltip: {
shared: true
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'Result in %'
}
},
series: [{
name: 'Result in %',
data: [{
<!-- if you want to create this concept dynamically using database, then you need to pass values here by using for loop -->
name: 'St. Fransis School',
y: 80
}, {
name: 'St. Xvier School',
y: 70
}, {
name: 'St. JOhn School',
y: 78
}, {
name: 'St. MIcheal School',
y: 89
}, {
name: 'St. Flemming School',
y: 80
}, {
name: 'St. Steve School',
y: 99
}, {
name: 'St. World School',
y: 100
}, {
name: 'St. India School',
y: 98
}, {
name: 'DAV School',
y: 97
}, {
name: 'High Hopes School',
y: 100
}]
}]
});
</script>
</body>
</html>
Check the Output of the complete Program
Regards
Using Asp.net
Comments
Post a Comment