1. 效果图
2. code
<template lang='pug'>
div.histogram-pane(:id='id')
svg.histogram-container
g.viewport
</template>
<script>
import * as d3 from 'd3'
import { Uuid } from '@/util/common'
export default {
name: 'learn',
data () {
return {
id: '',
width: 0,
height: 0,
padding: null,
dataSet: [
{
country: 'China',
gdp: [[2000, 11920], [2001, 13170], [2002, 14550], [2003, 16650], [2004, 19440], [2005, 22840], [2006, 27880],
[2007, 35040], [2008, 45470], [2009, 51050], [2010, 59540], [2011, 73140], [2012,