charts

bar chart with Matplotlib

孤街醉人 提交于 2020-05-30 02:46:08
问题 Here is my data structure: data = {'2013': {1:25,2:81,3:15}, '2014': {1:28, 2:65, 3:75}, '2015': {1:78,2:91,3:86 }} My x-axis is the number [1,2,3] My y-axis is the quantity of each number. For example: In 2013, 1 is x axis while its quantity is 25 . Print each individual graph for each year I would like to graph a bar chart, which uses matplotlib with legend on it. 回答1: import matplotlib.pyplot as plt import pandas as pd data = {'2013': {1:25,2:81,3:15}, '2014': {1:28, 2:65, 3:75}, '2015':

2 arrays one of values one of colors make D3 bar chart have color at same index of value

帅比萌擦擦* 提交于 2020-05-29 10:07:46
问题 I have 2 arrays: values = [1,2,3,4,5,4,7,2,9,10]; colors = ['red','red','blue','blue','green','green','orange','orange','pink','pink']; I am trying to build a D3 Bar chart where each bar has height of 10 times the value and corresponds to the color that has the same index as the value. This is what I have so far: d3.select("body").selectAll("div") .data(total_data) .enter() .append("div") .attr("class", "bar") .style("fill", function(d) { return colors[values.indexOf(d)]; }) However, say we

Chart.js Custom Image for Each Point

≯℡__Kan透↙ 提交于 2020-05-28 14:07:35
问题 I'm using Chart.js and I'm looking for help with custom images for each point on a scatter graph. I've tried using a javascript array of images but it isn't working. I'm new to canvas and html5. What I would like is for each point to be a small profile picture of the user instead of a circle. An example would be greatly appreciated. I currently have: var ctx = document.getElementById("member-graph-scatter"); var myChart = new Chart(ctx, { type: 'line', data: { datasets: [{ label: 'Miles /

How can I fill gaps in a dc.js series chart?

ぃ、小莉子 提交于 2020-05-28 07:34:49
问题 I have the following dc.js series chart: var data = [ {day: 1, service: 'ABC', count: 100}, {day: 2, service: 'ABC', count: 80}, {day: 4, service: 'ABC', count: 10}, {day: 7, service: 'XYZ', count: 380}, {day: 8, service: 'XYZ', count: 400} ]; var ndx = crossfilter(data); var dim = ndx.dimension(function (d) { return [d.service, d.day]; }); var grp = dim.group().reduceSum(function(d) { return +d.count; }); var chart = dc.seriesChart('#graph') .width(620) .height(175) .chart(function(c) {

How can I fill gaps in a dc.js series chart?

风流意气都作罢 提交于 2020-05-28 07:34:09
问题 I have the following dc.js series chart: var data = [ {day: 1, service: 'ABC', count: 100}, {day: 2, service: 'ABC', count: 80}, {day: 4, service: 'ABC', count: 10}, {day: 7, service: 'XYZ', count: 380}, {day: 8, service: 'XYZ', count: 400} ]; var ndx = crossfilter(data); var dim = ndx.dimension(function (d) { return [d.service, d.day]; }); var grp = dim.group().reduceSum(function(d) { return +d.count; }); var chart = dc.seriesChart('#graph') .width(620) .height(175) .chart(function(c) {

How can I fill gaps in a dc.js series chart?

て烟熏妆下的殇ゞ 提交于 2020-05-28 07:33:15
问题 I have the following dc.js series chart: var data = [ {day: 1, service: 'ABC', count: 100}, {day: 2, service: 'ABC', count: 80}, {day: 4, service: 'ABC', count: 10}, {day: 7, service: 'XYZ', count: 380}, {day: 8, service: 'XYZ', count: 400} ]; var ndx = crossfilter(data); var dim = ndx.dimension(function (d) { return [d.service, d.day]; }); var grp = dim.group().reduceSum(function(d) { return +d.count; }); var chart = dc.seriesChart('#graph') .width(620) .height(175) .chart(function(c) {

How can I fill gaps in a dc.js series chart?

筅森魡賤 提交于 2020-05-28 07:32:12
问题 I have the following dc.js series chart: var data = [ {day: 1, service: 'ABC', count: 100}, {day: 2, service: 'ABC', count: 80}, {day: 4, service: 'ABC', count: 10}, {day: 7, service: 'XYZ', count: 380}, {day: 8, service: 'XYZ', count: 400} ]; var ndx = crossfilter(data); var dim = ndx.dimension(function (d) { return [d.service, d.day]; }); var grp = dim.group().reduceSum(function(d) { return +d.count; }); var chart = dc.seriesChart('#graph') .width(620) .height(175) .chart(function(c) {

Excel Chart has no title error

两盒软妹~` 提交于 2020-05-27 04:14:36
问题 I'm working with VBA trying to make charts. The chart is created like it should, but when I try to define a title, I get this error: "run time error '-2147024809 (80070057): this object has no title." my VBA line is: ActiveChart.ChartTitle.Text = "From " & Cells(Start, Prev) & " To " & Cells(Start, Op) & " - Recomended Setup: 0" Does anyone has any idea why It's not working? (the same line worked on another chart already...) Thank you! 回答1: That is because you need to create the title before

Excel Chart has no title error

别说谁变了你拦得住时间么 提交于 2020-05-27 04:14:33
问题 I'm working with VBA trying to make charts. The chart is created like it should, but when I try to define a title, I get this error: "run time error '-2147024809 (80070057): this object has no title." my VBA line is: ActiveChart.ChartTitle.Text = "From " & Cells(Start, Prev) & " To " & Cells(Start, Op) & " - Recomended Setup: 0" Does anyone has any idea why It's not working? (the same line worked on another chart already...) Thank you! 回答1: That is because you need to create the title before

How to bind a dictionary to MSChart

邮差的信 提交于 2020-05-26 05:59:46
问题 I am trying to bind Dictionary to a Chart, Below is the code IDictionary<double, double> dict1 = new Dictionary<double, double>(); IList<double> list1 = new List<double>(); public Form1() { InitializeComponent(); InitialiseDictionary(); Series ser1 = new Series("My Series", 10); chart1.Series.Add(ser1); chart1.DataSource = dict1; chart1.DataBind(); } private void InitialiseDictionary() { for (int i = 0, j = 1; i < 1000;i = i + 100 , j=j+10) dict1.Add(i , j); } But I don't see the Chart or