123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              
<div id="main"></div>

<h2>About the Data</h2>
<ul>
<li>Tracking President Trump's Visits to Trump Properties - <a href="http://www.nbcnews.com/politics/donald-trump/how-much-time-trump-spending-trump-properties-n753366">NBC News</a>.</li>
<li>How many times has President Donald Trump played golf while in office? - <a href="https://thegolfnewsnet.com/golfnewsnetteam/2019/02/02/how-many-times-president-donald-trump-played-golf-in-office-103836/">Golf News Net</a>.</li>   
<li>Golf Becoming Obama's Passion - <a href="https://www.usnews.com/news/blogs/washington-whispers/2010/08/04/golf-becoming-obamas-passion">US News</a>.</li>
<li>Collection: President Clinton's Daily Schedule - <a href="https://clinton.presidentiallibraries.us/items/browse?collection=39&sort_field=Dublin+Core%2CDate&sort_dir=a">Clinton Digital Library</a>.</li>
</ul>

<h2>About the Chart</h2>
<ul>
<li>Chart powered by <a href="http://echarts.baidu.com">ECharts</a> by <a href="http://www.baidu.com">Baidu</a>.</li>
<li>Golf Icon by <a href="https://thenounproject.com/term/golf/34775/">Alex Auda Samora, UA</a> via The <a href="https://thenounproject.com">Noun Project</a>. </li>
<li>Last updated 5/11/19</li>
</ul>
            
          
!
            
              body {
	background-color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px; 
	color: #000;
}

a:link, a:visited {
	color: #4682b4;
}

a:hover {
	color: #4169e1;
}

#main	{
	width: 1000px;
	height: 700px;
}

li {
	margin-bottom: 15px;
}

ul {
	margin: 10px 10px 25px 10px;
}

h2	{
	margin: 15px 10px 10px 15px;
}
            
          
!
            
                      // based ready dom, initialize echarts instance 
		var chart = echarts.init(document.getElementById('main'), 'inspired');
		// Custom Themes: azul, caravan, carp, dark-blue, dark-bold, dark-digerati, dark-fresh-cut, eduardo, fresh-cut, inspired, jazz, london
		// ECharts Default Themes v2 & v3: blue, dark, gray, default, green, helianthus, infographic, macarons, macarons2, mint, red, roma, sakura, shine, vintage

// Icon by Creative Stall, PK via The Noun Project  https://thenounproject.com/term/ballot/381705/
var pathSymbols = {
    golf: 'path://M63,26.964c-2.87,0-5.542,0.22-7.821,0.594V10.795l9.938-2.711L55.179,5h-1.104v22.758C50.395,28.49,48,29.66,48,30.981  C48,33.201,54.716,35,63,35s15-1.799,15-4.019C78,28.763,71.284,26.964,63,26.964z M56.927,32.289c-1.271,0-2.3-0.586-2.3-1.308  c0-0.721,1.03-1.307,2.3-1.307s2.3,0.586,2.3,1.307C59.227,31.703,58.197,32.289,56.927,32.289z'
};

var labelSetting = {
    normal: {
        show: true,
        position: 'outside',
        offset: [10, 0],
        textStyle: {
            fontSize: 16
        }
    }
};


option = {
    title: {
        text: 'Days in Office: 841, 557, 710'
    },
    legend: {
        data: ['Trump', 'President Obama', 'President Clinton']
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    grid: {
        containLabel: true,
        left: 20
    },
    yAxis: {
        data: ['Days Golfing'],
        inverse: true,
        axisLine: {show: false},
        axisTick: {show: false},
        axisLabel: {
            margin: 30,
            textStyle: {
                fontSize: 14
            }
        },
        axisPointer: {
            label: {
                show: true,
                margin: 30
            }
        }
    },
    xAxis: {
        splitLine: {show: false},
        axisLabel: {show: false},
        axisTick: {show: false},
        axisLine: {show: false}
    },
    series: [{
        name: 'Trump',
        type: 'pictorialBar',
        label: labelSetting,
        symbolRepeat: true,
        symbolSize: ['80%', '60%'],
        barCategoryGap: '10%',
        data: [{
            value: 187,
            symbol: pathSymbols.golf
        }]
    }, {
        name: 'President Obama',
        type: 'pictorialBar',
        barGap: '10%',
        label: labelSetting,
        symbolRepeat: true,
        symbolSize: ['80%', '60%'],
        data: [{
            value: 43,
            symbol: pathSymbols.golf
        }]
}, {
        name: 'President Clinton',
        type: 'pictorialBar',
        barGap: '10%',
        label: labelSetting,
        symbolRepeat: true,
        symbolSize: ['80%', '60%'],
        data: [{
            value: 63,
            symbol: pathSymbols.golf
        }]
    }]
};

		// Use just the specified configurations and data charts. 
		chart.setOption(option);
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console