Documentation
SolutionDeveloperComplianceProjects
  • Getting Started
  • Technology
    • Application Framework
    • Object-Relational Mapping
    • Security Framework
    • Architecture Pattern
    • API Management
  • Environment
    • Development Tool
    • Database Server
    • Web Server
  • PRESENTATION
    • Design Material
    • HTML Helpers
    • Icon Images
    • Custom CSS
    • JQuery Plugin
      • DataTables
      • Tabs
      • Date Picker
      • Calendar
      • Chart
      • Treeview
    • Client Script
      • Open Modal
      • Close Modal
      • Handle return data
      • Load Content
      • Change Hash
      • Change Title
      • Get actual Hash
      • Get Content
      • Update Content
      • Delete Content
      • Get Partial Content
      • Get Partial Content Async
      • Update Partial Content
      • Update Partial Content Async
      • Delete Partial Content
      • Get Action
      • Update Action
      • Delete Action
      • Cascading Dropdown
      • Display Document
    • MVC View
  • BACKEND
    • Base Controller
    • Controller
    • Base Model
    • View Model
    • Class Utility
      • Constant Values
      • Global Properties
      • Option Helper
      • Setting Helper
    • Data Repository
      • Read Columns
      • Read All Columns
      • Read First Record
      • Read by Primary Key
      • Find Record
      • Insert Record
      • Update Record
      • Delete Entity
      • Delete by Criteria
      • Delete by Primary Key
      • Counting Record
      • Check Exist
      • Generate Row-Id
    • Unit Of Work
    • Data Entity
  • Application Features
    • Account Management
    • Navigation Editor
    • Access Control
  • Examples
    • Simple Page
    • Master Detail
    • Editor Template
Powered by GitBook
On this page
  • General information
  • Installation
  • Examples
  • Example 1: Pie Chart
  • Example 2:
  1. PRESENTATION
  2. JQuery Plugin

Chart

PreviousCalendarNextTreeview

Last updated 2 years ago

General information

jqPlot is a JavaScript plotting library for creating charts and graphs with jQuery. It provides a simple way to produce common types of graphics in a browser using JavaScript and HTML5 canvas. It is designed to be flexible, easy to use, and integrate well with other libraries.

Installation

  1. Open the following link:

  2. Download the latest zip-file

  3. Extract the files to the folder "Plugins" > "jqplot" (Create the file if it does not exist yet)

  4. Add the following lines of code in the "Layout.cshtml" file of the project:

<link rel="stylesheet" href="~/Plugins/jqplot/jquery.jqplot.css" />
<script type="text/javascript" src="~/Plugins/jqplot/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.barRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.canvasAxisLabelRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.canvasAxisTickRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.canvasOverlay.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.canvasTextRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.categoryAxisRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.cursor.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.dateAxisRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.enhancedLegendRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.enhancedPieLegendRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.highlighter.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.logAxisRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.ohlcRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.pieRenderer.js"></script>
<script type="text/javascript" src="~/Plugins/jqplot/jqplot.pointLabels.js"></script>

Examples

Example 1: Pie Chart

A pie chart is implemented in the following way:

<script type="text/javascript">

    var configPie = {
        gridPadding: { top: 0, right: 10, bottom: 0, left: 10 },
        grid: { drawBorder: false, drawGridlines: false, backgroundColor: 'transparent', shadow: false },
        seriesColors: ['#ff5252', '#e6f7ff', '#ffca57', '#a1d490'], // Series including active
        seriesDefaults: { renderer: $.jqplot.PieRenderer, rendererOptions: { shadow: false, padding: 0, showDataLabels: true, dataLabels: 'value', sliceMargin: 5, startAngle: -90 } }
    };

    $(document).ready(function () {
        scalePie();
    });

    function scalePie() {
        var plot1 = $.jqplot('pieStarted', [[['Completed', 20], ['Active', 14], ['In Process', 7], ['Open', 44]]], configPie);
        plot1.replot({ resetAxes: true });
    }
    
</script>

The above code creates the following chart:

Example 2:

http://www.jqplot.com/download/