<!doctype html> <html class="zc-html"> <head> <meta charset="utf-8"> <title>ZingSoft Demo</title> <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script> <style> .zc-body { background: #fff; } .chart--container { height: 100%; width: 100%; min-height: 530px; } .zc-ref { display: none; } </style> </head> <body class="zc-body"> <div id="myChart" class="chart--container"> <a href="https://www.zingchart.com/" rel="noopener" class="zc-ref">Powered by ZingChart</a> </div> <script> ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"]; let cols = 40, rows = 10; let img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAAgCAYAAACVf3P1AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABGTSURBVHhenZpPSF5Xn8cFZXbhfYfale/oouBQyEKy0tl140CCom2oFiqVqVUbattgGalggq6CggoS0IUJk2SRvI5/cOVCQTcVEbMIDORlEKmT+GcVBDFGE575/G7O7+SX8xw9T7L43HO+t+d7Semn9z459xblcrmi2r//LaT43//7bzdhE57Cr1AUIl2h6q9NIcVVf22+CZvwFH4Fzr+P9kPm/rm8eP6v/3ITNuEp/BpbdxYT/1lUPNlbdBM24Sl8UP8fRX8W/2/R/92ETXgKH9QvqlgpLvrsj5uwCU/hg/r9pbPF/Z/M3YRNeAof1K/59i/F/9byl5uwCU/hg/r/U/Rp8T+KPr0Jm/AUPqj/rz9+V/x513/chE14Cmf2s0NEwE4EywV8BYUK2IlguYCvgH9WkICdSJcL+Cq2NgYCdiJdLqDgPgJ2Il0uoOA+AnYiXS6g4D4CdiJdLqDgPgJ2Il0uoOA+AnYiXS6g4D4CdiJdLiDazw6hWDAH7wmIlOOBpP4ioVgwB4GATeOBpL4fgmxzgXw5pByPrY2BbHOBfDmkLLiPbHOBfPwH+LPgPrLNBfLlkLLgPrLNBfLlkLLgPrLNBfLlkLLgPrLNBfLlkLLgPrLNBfLlkDLazw4IFjIKoY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ggg=='; let plots = [{ text: 'Walmart', color: '#47AC1C', employees: 2200000, medianpay: 19177 }, { text: 'Amazon', color: '#301058', employees: 798000, medianpay: 28466 }, { text: 'Yum China', color: '#B2101D', employees: 450000, medianpay: 9111 }, { text: 'Kroger', color: '#9D7A00', employees: 435000, medianpay: 21075 }, { text: 'Home Depot', color: '#DB00E3', employees: 415700, medianpay: 21095 }, { text: 'Berkshire H.', color: '#0023C6', employees: 391500, medianpay: 53510 }, { text: 'FedEx', color: '#3A5D0F', employees: 389000, medianpay: 50017 }, { text: 'IBM', color: '#8113B0', employees: 383800, medianpay: 54491 }, { text: 'UPS', color: '#D90015', employees: 377640, medianpay: 53443 }, { text: 'Target Corp.', color: '#296D62', employees: 368000, medianpay: 20581 } ]; let chartConfig = { graphset: [{ type: 'scatter', height: '100%', width: 18 * cols + 40, x: 0, y: 0, title: { text: 'Top 10 United States Largest Private Employers (as of 2020)' }, plotarea: { maskTolerance: [99, 99], margin: '50px 20px 100px 20px' }, legend: { borderWidth: 0, height: '80px', layout: '2x5', margin: 'auto auto 0 auto', offsetY: '10px', marker: { type: 'rectangle', backgroundColor: 'none', borderWidth: 0, width: '16px', height: '32px' } }, scaleX: { visible: false }, scaleY: { mirrored: true, visible: false }, tooltip: { text: '<b>%plot-text:</b> %data-employees employees (%data-percent%)', backgroundColor: '#eee', borderColor: '#333', fontSize: '17px', padding: '20px', fontWeight: null, thousandsSeparator: ',' }, plot: { animation: { effect: 'ANIMATION_FADE_IN', method: 'ANIMATION_LINEAR', sequence: 'ANIMATION_BY_PLOT', speed: 150 }, marker: { type: 'rectangle', backgroundColor: 'none', width: '16px', height: '32px' }, hoverMarker: { type: 'none', visible: false } }, series: [] }, { type: 'hbar', width: '300px', height: '100%', x: 18 * cols + 40, y: 0, plotarea: { margin: '20px 20px 70px 100px' }, tooltip: { visible: false }, scaleX: { visible: false }, scaleY: { lineWidth: 0, guide: { visible: false }, item: { visible: false }, label: { text: 'Median annual pay', align: 'left', color: '#000', fontSize: '15px', padding: 0 }, tick: { visible: false } }, source: { text: 'Source: Wikipedia', align: 'left', target: '_blank', url: 'https://en.wikipedia.org/wiki/List_of_largest_employers_in_the_United_States' }, plot: { animation: { effect: 'ANIMATION_EXPAND_BOTTOM', method: 'ANIMATION_LINEAR', sequence: 'ANIMATION_BY_PLOT', speed: 150 }, barSpace: 0.1, barsSpaceLeft: 0.1, barsSpaceRight: 0.1, valueBox: [{ text: '$%node-value', placement: 'top-out', rules: [{ rule: '%node-value > 25000', placement: 'top-in', color: '#fff' }], thousandsSeparator: ',' }, { text: '%plot-text', color: '#000', placement: 'bottom-out' } ] }, series: [] } ] }; // calculate number of items per plot let total_employees = 0; for (let p = 0; p < plots.length; p++) { total_employees += plots[p].employees; } let total_items = 0 for (let p = 0; p < plots.length; p++) { let pc = (plots[p].employees / total_employees); let items = Math.round((cols * rows) * pc); if (p === plots.length - 1) { // avoid rounding conflicts plots[p].items = (cols * rows) - total_items; } else { plots[p].items = items; } plots[p].dataPercent = (100 * pc).toFixed(2); total_items += items; } let col = 0, row = 0; for (let p = 0; p < plots.length; p++) { chartConfig.graphset[1].series.push({ text: plots[p].text, values: [plots[p].medianpay], backgroundColor: plots[p].color }); chartConfig.graphset[0].series.push({ text: plots[p].text, dataPercent: plots[p].dataPercent, dataEmployees: plots[p].employees, tooltip: { color: plots[p].color }, marker: { backgroundRepeat: 'no-repeat', backgroundImage: img, backgroundPosition: -p * 16 + 'px 0px' }, legendMarker: { backgroundRepeat: 'no-repeat', backgroundImage: img, backgroundPosition: -p * 16 + 'px 0px' }, values: [] }); for (let n = 0; n < plots[p].items; n++) { chartConfig.graphset[0].series[p].values.push([col, row]); col++; if (col === cols) { col = 0; row++; } } } zingchart.render({ id: 'myChart', width: '100%', height: '100%', output: 'svg', data: chartConfig }); </script> </body> </html>
<!doctype html> <html class="zc-html"> <head> <meta charset="utf-8"> <title>ZingSoft Demo</title> <script src="https://cdn.zingchart.com/zingchart.min.js"></script> </head> <body class="zc-body"> <div id="myChart" class="chart--container"> <a href="https://www.zingchart.com/" rel="noopener" class="zc-ref">Powered by ZingChart</a> </div> </body> </html>
.zc-body { background: #fff; } .chart--container { height: 100%; width: 100%; min-height: 530px; } .zc-ref { display: none; }
let cols = 40, rows = 10; let img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAAgCAYAAACVf3P1AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABGTSURBVHhenZpPSF5Xn8cFZXbhfYfale/oouBQyEKy0tl140CCom2oFiqVqVUbattgGalggq6CggoS0IUJk2SRvI5/cOVCQTcVEbMIDORlEKmT+GcVBDFGE575/G7O7+SX8xw9T7L43HO+t+d7Semn9z459xblcrmi2r//LaT43//7bzdhE57Cr1AUIl2h6q9NIcVVf22+CZvwFH4Fzr+P9kPm/rm8eP6v/3ITNuEp/BpbdxYT/1lUPNlbdBM24Sl8UP8fRX8W/2/R/92ETXgKH9QvqlgpLvrsj5uwCU/hg/r9pbPF/Z/M3YRNeAof1K/59i/F/9byl5uwCU/hg/r/U/Rp8T+KPr0Jm/AUPqj/rz9+V/x513/chE14Cmf2s0NEwE4EywV8BYUK2IlguYCvgH9WkICdSJcL+Cq2NgYCdiJdLqDgPgJ2Il0uoOA+AnYiXS6g4D4CdiJdLqDgPgJ2Il0uoOA+AnYiXS6g4D4CdiJdLiDazw6hWDAH7wmIlOOBpP4ioVgwB4GATeOBpL4fgmxzgXw5pByPrY2BbHOBfDmkLLiPbHOBfPwH+LPgPrLNBfLlkLLgPrLNBfLlkLLgPrLNBfLlkLLgPrLNBfLlkLLgPrLNBfLlkDLazw4IFjIKoYC/f4CAoxAK+PsHCDgaEfD32NoYCDcaEbDgPsKNRgQsuI9woxEBC+4j3GhEwIL7CDcaEbDgPsKNRgQsuI9woxEBo/3sEIoF5Uj32Ai4zLnSYI2/SCgWlCPdYyPgMudKgzW+H4Js5Uj32Ai4zLnS2NoYyFaOdI+NgMucK7i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w+uXorXMXKGOOkz5/9kewjmXxy9Va40tkxxkmfP5lL9pFMPrnKhOORO8Y4qRmSfSSTT64y4XjkjjFOaoZkH8nkk6tMOB65Y4yTmiGvnx2sVNAHKuAw47hm+AX8Wr2IlQr6QAUcZhx/l5t/Ab9W+xYk61PhEHCYcVwz/BLrWJCsT4VDwGHGcc2Q7CNZnwqHgMOM45oh2UeyPi9cxcow47jPn/2R7CNZnxeudHaYcdznT+aSfSTrU+EQcJhxXDMk+0jWp8Ih4DDjuGZI9pGsT4VDwGHGcc2Q188O9i8W0O9kEwGHGG9rBvl9GBHw3V8soN/JJgIOMd5+l7Pfh5l8gvYtSNevwjEfYrytGbpjHQvS9atwzIcYb2uGZB/p+lU45kOMtzVDso90/V64ipUhxts+8/sw1rEgXb8XrnR2iPG2z/w+jHUsSNevwjEfYrytGZJ9pOtX4ZgPMd7WDMk+0vWrcMyHGG9rhrx+dggEHHCyiYA3GAc1w2+QEnDAySYC3mAcfJebf4NMPkH7FqQbUOGY32Ac1Ay/xToWpBtQ4ZjfYBzUDMk+0g2ocMxvMA5qhmQf6Qa8cBUrNxgHff7sj2Qf6Qa8cKWzNxgHff5kLtlHugEVjvkNxkHNkOwj3YAKx/wG46BmSPaRbkCFY36DcVAz5PWzQyDgJeRah1XmlVBl8uduTYZeJBDwEnKtwyrzSqgy+XO3JkP7FqS7hGjrsMq8EqpM/jzWsSDdJURbh1XmlVBlcrKPdJcQbR1WmVdClcnJPtJdQrR1WGVeCVUmJ/tIdwnR1mGVeSVUmZzsI90lRFuHVeaVUGVyso90lxBtHVaZV0KVyck+0l1CtHVYZV4JVSYH/VzR/wMaxUlk7VcZYAAAAABJRU5ErkJggg=='; let plots = [{ text: 'Walmart', color: '#47AC1C', employees: 2200000, medianpay: 19177 }, { text: 'Amazon', color: '#301058', employees: 798000, medianpay: 28466 }, { text: 'Yum China', color: '#B2101D', employees: 450000, medianpay: 9111 }, { text: 'Kroger', color: '#9D7A00', employees: 435000, medianpay: 21075 }, { text: 'Home Depot', color: '#DB00E3', employees: 415700, medianpay: 21095 }, { text: 'Berkshire H.', color: '#0023C6', employees: 391500, medianpay: 53510 }, { text: 'FedEx', color: '#3A5D0F', employees: 389000, medianpay: 50017 }, { text: 'IBM', color: '#8113B0', employees: 383800, medianpay: 54491 }, { text: 'UPS', color: '#D90015', employees: 377640, medianpay: 53443 }, { text: 'Target Corp.', color: '#296D62', employees: 368000, medianpay: 20581 } ]; let chartConfig = { graphset: [{ type: 'scatter', height: '100%', width: 18 * cols + 40, x: 0, y: 0, title: { text: 'Top 10 United States Largest Private Employers (as of 2020)' }, plotarea: { maskTolerance: [99, 99], margin: '50px 20px 100px 20px' }, legend: { borderWidth: 0, height: '80px', layout: '2x5', margin: 'auto auto 0 auto', offsetY: '10px', marker: { type: 'rectangle', backgroundColor: 'none', borderWidth: 0, width: '16px', height: '32px' } }, scaleX: { visible: false }, scaleY: { mirrored: true, visible: false }, tooltip: { text: '<b>%plot-text:</b> %data-employees employees (%data-percent%)', backgroundColor: '#eee', borderColor: '#333', fontSize: '17px', padding: '20px', fontWeight: null, thousandsSeparator: ',' }, plot: { animation: { effect: 'ANIMATION_FADE_IN', method: 'ANIMATION_LINEAR', sequence: 'ANIMATION_BY_PLOT', speed: 150 }, marker: { type: 'rectangle', backgroundColor: 'none', width: '16px', height: '32px' }, hoverMarker: { type: 'none', visible: false } }, series: [] }, { type: 'hbar', width: '300px', height: '100%', x: 18 * cols + 40, y: 0, plotarea: { margin: '20px 20px 70px 100px' }, tooltip: { visible: false }, scaleX: { visible: false }, scaleY: { lineWidth: 0, guide: { visible: false }, item: { visible: false }, label: { text: 'Median annual pay', align: 'left', color: '#000', fontSize: '15px', padding: 0 }, tick: { visible: false } }, source: { text: 'Source: Wikipedia', align: 'left', target: '_blank', url: 'https://en.wikipedia.org/wiki/List_of_largest_employers_in_the_United_States' }, plot: { animation: { effect: 'ANIMATION_EXPAND_BOTTOM', method: 'ANIMATION_LINEAR', sequence: 'ANIMATION_BY_PLOT', speed: 150 }, barSpace: 0.1, barsSpaceLeft: 0.1, barsSpaceRight: 0.1, valueBox: [{ text: '$%node-value', placement: 'top-out', rules: [{ rule: '%node-value > 25000', placement: 'top-in', color: '#fff' }], thousandsSeparator: ',' }, { text: '%plot-text', color: '#000', placement: 'bottom-out' } ] }, series: [] } ] }; // calculate number of items per plot let total_employees = 0; for (let p = 0; p < plots.length; p++) { total_employees += plots[p].employees; } let total_items = 0 for (let p = 0; p < plots.length; p++) { let pc = (plots[p].employees / total_employees); let items = Math.round((cols * rows) * pc); if (p === plots.length - 1) { // avoid rounding conflicts plots[p].items = (cols * rows) - total_items; } else { plots[p].items = items; } plots[p].dataPercent = (100 * pc).toFixed(2); total_items += items; } let col = 0, row = 0; for (let p = 0; p < plots.length; p++) { chartConfig.graphset[1].series.push({ text: plots[p].text, values: [plots[p].medianpay], backgroundColor: plots[p].color }); chartConfig.graphset[0].series.push({ text: plots[p].text, dataPercent: plots[p].dataPercent, dataEmployees: plots[p].employees, tooltip: { color: plots[p].color }, marker: { backgroundRepeat: 'no-repeat', backgroundImage: img, backgroundPosition: -p * 16 + 'px 0px' }, legendMarker: { backgroundRepeat: 'no-repeat', backgroundImage: img, backgroundPosition: -p * 16 + 'px 0px' }, values: [] }); for (let n = 0; n < plots[p].items; n++) { chartConfig.graphset[0].series[p].values.push([col, row]); col++; if (col === cols) { col = 0; row++; } } } zingchart.render({ id: 'myChart', width: '100%', height: '100%', output: 'svg', data: chartConfig });