New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

xg-xcharts

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xg-xcharts

charts base on d3.js

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

xCharts

Installation

You can choose one of the following methods:

  • Use NPM.
npm install xg-xcharts
  • Download source code in github.

Get Started

  1. Add xCharts to your project.
<!DOCTYPE html>
<html lang="en">
  	<head>
  		<meta charset="UTF-8">
  		<title>My first xCharts demo</title>
  		<!-- ... -->  
  		
  		<!-- add xCharts.css -->
  		<link rel="stylesheet" href="./dist/xCharts.css">
  	</head>
  	<body>
  		<div id="chartContainer" style="width: 1000px; height: 500px;"></div>
  		<!-- ... -->
  		
  		<!-- must add d3.js before xCharts.min.js -->
  		<script src="d3.js"></script>
  		<script src="./dist/xCharts.min.js"></script>
  		
  		<!-- Your code -->
  	</body>
</html>  
  1. Use xCharts to create a chart.
var chart = xCharts(document.querySelector('#chartContainer'));
var option = {
  	title: {
  	    text: '单轴折线图-示例',
  	},
  	legend: {
  	    data: ['网易','腾讯'],
  	    x: 'center'
  	},
  	tooltip: {
  	    trigger: 'axis'
  	},
  	xAxis: [
  	    {
  	        type: 'category',
  	        data: ['一', '二', '三', '四', '五', '六', '日'],
  	        tickFormat: function(data) {
  	            return '周'+data;
  	        }
  	    }
  	],
  	yAxis: [
  	    {
  	        type: 'value',
  	    }
  	],
  	resize: {
  	    enable:true
  	},
  	series: [
  	    {
  	        type: 'line',
  	        name: '网易',
  	        data: [100, 230, 500, 160, 402, 340, 380]
  	    },
  	    {
  	        type: 'line',
  	        name: '腾讯',
  	        data: [300, 450, 347, 792, 325, 683, 123]
  	    }
  	]
};
chart.loadConfig(option);

If your project support AMD, code like this.

require(['xCharts'],function(xCharts){
  // your code  
  // ...
});

Or your project support CMD, code like this.

var xCharts = require('xCharts');
// your code   
// ... 

More examples

You can access http://xgfe.github.io/xCharts/ for more examples and API documents.

Contact

Keywords

FAQs

Package last updated on 08 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc