An open source visual chart library based on JavaScript

An open source visual chart library based on JavaScript

2022-09-16 0 820
Resource Number 38595 Last Updated 2025-02-24
¥ 0HKD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

This issue recommends Apache ECharts, an open source javascript-based visual chart library.

An open source visual chart library based on JavaScript插图

ECharts is an open source visual library implemented by JavaScript, which can run smoothly on PC and mobile devices and is compatible with most current browsers (IE9/10/11, Chrome, Firefox, Safari, etc.). The underlying dependency on the vector graphics library ZRender provides intuitive, interactive, and highly customizable data visualizations.

Feature

Rich chart types: Provides more than 20 charts and a dozen components out of the box, and supports any combination of charts and components.

Powerful rendering engine: one-click switch between Canvas and SVG twin engines, incremental rendering, stream loading and other technologies to achieve smooth interaction of tens of millions of data.

Professional data analysis: Manage data through data sets, support data filtering, clustering and regression, and help realize multi-dimensional analysis of the same data.

Elegant visual design: The default design follows visual principles, supports responsive design, and provides flexible configuration items for developers to customize.

Healthy open source community: Active community users ensure the healthy development of the project, and also contribute a wealth of third-party plug-ins to meet the needs of different scenarios.

Friendly accessibility: intelligently generated chart descriptions and decals to help visually impaired people understand the chart content and read the story behind the chart.

Mobile terminal optimization: ECharts has made detailed optimization for mobile terminal interaction, for example, it is suitable for finger scaling and translation in coordinate system on small screen of mobile terminal.

Get Started

1 Obtain Apache ECharts

Apache ECharts supports a variety of download methods, you can choose any of the following methods to install according to the actual situation of the project.

  • Obtained from GitHub:

The release page of the apache/echarts project will find links to each version. Click Source code in Assets at the bottom of the download page, and echarts.js in dist directory after decompression is a file containing complete ECharts functions.

https://github.com/apache/echarts/releases
  • From NPM:
npm install echarts --save
  • From the CDN:

https://www.jsdelivr.com/package/npm/echarts select dist/echarts js, click and save as echarts. Js file.

2 Importing Apache ECharts

Create an index.html file in the directory where you just saved echarts.js with the following content:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <!-- Import the ECharts file you just downloaded -->
    <script src="echarts.js"></script>
  </head>
</html>

Open this index.html and you’ll see a blank space. But don’t worry, open the console to make sure there are no error messages, and you can proceed to the next step.

3 Draw a simple chart

Before drawing we need to prepare a DOM container with defined height and width for ECharts. In the example just now. /head>  After that, add:

<body>
  <!-- 为 ECharts Get one that defines the width and heightDOM -->
  <div id="main" style="width: 600px;height:400px;"></div>
</body>

Then you can initialize an echarts instance with the echarts.init method and generate a simple bar graph with the setOption method. Here is the complete code:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>ECharts</title>
    < ! -- Import the ECharts file you just downloaded --> 
    <script src="echarts.js"></script>
  </head>
  <body>
    <!-- 为 ECharts Get one that defines the width and height DOM -->
    <div id="main" style="width: 600px;height:400px;"></div>
    <script type="text/javascript">
      // Initializes the echarts instance based on the prepared dom 
      var myChart = echarts.init(document.getElementById('main'));

      // Specify configuration items and data for the chart 
      var option = {
        title: {
          text: 'EChartsGetting started example'
        },
        tooltip: {},
        legend: {
          data: ['Sales']
        },
        xAxis: {
          data:  [< span class = "HLJS - string" > 'shirt < / span >, < span class = "HLJS - string" >' sweaters' < / span >, < span class = "HLJS - string" > 'snow spins unlined upper garment' < / span >, < span class = "HLJS - string" > 'pants' < / span >, < span class = "HLJS - string" >' high heels' < / span >, < span class = "HLJS - string" > < / span > 'socks']
        },
        yAxis: {},
        series: [
          {
            name: 'Sales',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
          }
        ]
      };

      // Display the chart using the configuration items and data just specified. 
      myChart.setOption(option);
    </script>
  </body>
</html>

So your first chart is born!

An open source visual chart library based on JavaScript插图1

Chart example

Line chart

An open source visual chart library based on JavaScript插图2

Line chart stack

An open source visual chart library based on JavaScript插图3

Stack area map

An open source visual chart library based on JavaScript插图4

Gradient stack area map

An open source visual chart library based on JavaScript插图5

Beijing AQI visualization

Bar chart

An open source visual chart library based on JavaScript插图6

Stacked bar graph

An open source visual chart library based on JavaScript插图7

Multi-y axis

An open source visual chart library based on JavaScript插图8

Stacked bar graph

Pie chart

An open source visual chart library based on JavaScript插图9

Nightingale rose

An open source visual chart library based on JavaScript插图10

Nested ring graph

Geographical coordinates/map

An open source visual chart library based on JavaScript插图11

Histogram animation

Diagram

An open source visual chart library based on JavaScript插图12

Character diagram (circular layout)

An open source visual chart library based on JavaScript插图13

NPM dependency graph

Rectangular tree

An open source visual chart library based on JavaScript插图14

Disk usage

Rising Sun graph

An open source visual chart library based on JavaScript插图15

Drink Flavors

Parallel coordinate system

An open source visual chart library based on JavaScript插图16

AQI distribution (parallel)

An open source visual chart library based on JavaScript插图17

Nutrient structure (parallel coordinates)

An open source visual chart library based on JavaScript插图18

Scatter matrix and parallel coordinates

—END—

Component preview address:
https://echarts.apache.org/examples/zh/index.html

Open Source protocol: Apache2.0

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free Source Code An open source visual chart library based on JavaScript https://ictcoder.com/an-open-source-visual-chart-library-based-on-javascript/

Share free open-source source code

Q&A
  • 1. Automatic: After making an online payment, click the (Download) link to download the source code; 2. Manual: Contact the seller or the official to check if the template is consistent. Then, place an order and make payment online. The seller ships the goods, and both parties inspect and confirm that there are no issues. ICTcoder will then settle the payment for the seller. Note: Please ensure to place your order and make payment through ICTcoder. If you do not place your order and make payment through ICTcoder, and the seller sends fake source code or encounters any issues, ICTcoder will not assist in resolving them, nor can we guarantee your funds!
View details
  • 1. Default transaction cycle for source code: The seller manually ships the goods within 1-3 days. The amount paid by the user will be held in escrow by ICTcoder until 7 days after the transaction is completed and both parties confirm that there are no issues. ICTcoder will then settle with the seller. In case of any disputes, ICTcoder will have staff to assist in handling until the dispute is resolved or a refund is made! If the buyer places an order and makes payment not through ICTcoder, any issues and disputes have nothing to do with ICTcoder, and ICTcoder will not be responsible for any liabilities!
View details
  • 1. ICTcoder will permanently archive the transaction process between both parties and snapshots of the traded goods to ensure the authenticity, validity, and security of the transaction! 2. ICTcoder cannot guarantee services such as "permanent package updates" and "permanent technical support" after the merchant's commitment. Buyers are advised to identify these services on their own. If necessary, they can contact ICTcoder for assistance; 3. When both website demonstration and image demonstration exist in the source code, and the text descriptions of the website and images are inconsistent, the text description of the image shall prevail as the basis for dispute resolution (excluding special statements or agreements); 4. If there is no statement such as "no legal basis for refund" or similar content, any indication on the product that "once sold, no refunds will be supported" or other similar declarations shall be deemed invalid; 5. Before the buyer places an order and makes payment, the transaction details agreed upon by both parties via WhatsApp or email can also serve as the basis for dispute resolution (in case of any inconsistency between the agreement and the description of the conflict, the agreement shall prevail); 6. Since chat records and email records can serve as the basis for dispute resolution, both parties should only communicate with each other through the contact information left on the system when contacting each other, in order to prevent the other party from denying their own commitments. 7. Although the probability of disputes is low, it is essential to retain important information such as chat records, text messages, and email records, in case a dispute arises, so that ICTcoder can intervene quickly.
View details
  • 1. As a third-party intermediary platform, ICTcoder solely protects transaction security and the rights and interests of both buyers and sellers based on the transaction contract (product description, agreed content before the transaction); 2. For online trading projects not on the ICTcoder platform, any consequences are unrelated to this platform; regardless of the reason why the seller requests an offline transaction, please contact the administrator to report.
View details

Related Source code

ICTcoder Customer Service

24-hour online professional services