dimple.js

dimple.js How can I change the labels of a chart axis without changing the data?

痞子三分冷 提交于 2020-01-01 16:47:53
问题 Say we have the bar chart of the example http://dimplejs.org/examples_viewer.html?id=bars_vertical and I want to change the x axis label from "Months" to "Meses". How can I do that? 回答1: Instead of changing the titleShape after drawing, you can also change the title directly before drawing. To do so, simply assign the title property: var chart = new dimple.chart(svg, data); var x = chart.addCategoryAxis("x", ["Fruit", "Year"]); x.title = "My New Title"; 回答2: After drawing you can access the

Measure axis - limit tick values

笑着哭i 提交于 2019-12-31 05:28:28
问题 I have chart looking like that: I use measure axis for Y: y = myChart.addMeasureAxis("y", "rate"); y.tickFormat = ",.4f"; As you can see ticks starts from 0.0000 while data has values starting from a bit above 3.0000. Is it possible to display y ticks starting from 2.5000 for example? I tried: y.overrideMin = 2; but it does not work as I expect. The x axis disappears: Thank you. 回答1: I'm afraid overriding minimum axis values is a little suboptimal at the moment. There is a workaround but it's

D3 Dimple - How to show multiple dimple charts on same page?

北慕城南 提交于 2019-12-31 03:45:45
问题 I'm making an html page with several examples of charts that I will be using. On the page I have a Dimple line graph, a pie chart, a wordcloud etc. When I try to add a second dimple graph - this time a bar graph, the first dimple line graph that I already have on the page is drawn on top of my bar graph: My HTML file looks like this: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>D3 Graphs</title> <link rel="stylesheet" type="text/css" href="_/base.css"> <link rel=

Prevent dimple from renaming columns on redraw

痞子三分冷 提交于 2019-12-25 18:44:18
问题 I renamed my column names as explained here: dimple.js How can I change the labels of a chart axis without changing the data? The problem is that the column names change back to default on redraw. I redraw on page resize with parameter noDataChange = true as shown in this example: http://dimplejs.org/advanced_examples_viewer.html?id=advanced_responsive_sizing Any ideas on how to prevent reverting column names to default? EDIT: So far I've tried to rename the axes again on each resize, but

TypeError/Undefined when adding conditional formatting to my bar chart

戏子无情 提交于 2019-12-24 05:52:37
问题 I'm trying to add conditional formatting to my simple bar chart. It's partially working, until I attempt to hover one of the bars, then I get the following error: TypeError: c[(this.position + "Field")] is undefined Contents of data.csv : date,est_sleep,bool_field 2017-11-01,7.5,0 2017-10-31,8,0 2017-10-30,7,1 HTML Code: <div id="chartContainer"> <script type="text/javascript"> d3.csv("data.csv", function(data) { var svg = dimple.newSvg("#chartContainer", 500, 600); var myChart = new dimple

How to use series.stack = false in dimple.js to suppress aggregation; different symbols for each series

人走茶凉 提交于 2019-12-24 03:29:43
问题 I am trying to suppress aggregation of data for given months using dimple.js' s3.stacked = false toggle, but it won't do so. How to do aggregation suppression properly in dimple.js? The code below should not add up the profit for 05/2013, at least that is what I want to achieve. I tried to use "Profit" in s3 = chart.addSeries("Profit in each unit", dimple.plot.bubble, [x,y3]); instead of "Profit in each unit" and then there is no aggregation, but the bubbles change colors across the s3 series

Dimple JS add vertical line

帅比萌擦擦* 提交于 2019-12-23 21:56:43
问题 I am trying to draw a vertical line in Dimple. I have seen this post: How to draw a vertical line with dimple? However, the example provided there is not working for me. It is only adding a point where instead I'd like a line to be drawn. I cannot find anything in the docs, nor on StackOverflow, nor via Googling and I would think this should be an easy thing to do- but so far it has proven not to be. Any help would be appreciated. Fiddle: http://jsfiddle.net/4w6gkq5s/27/ <!DOCTYPE html> <html

How to change the axis title with rCharts, dPlot and dimple

若如初见. 提交于 2019-12-22 17:58:34
问题 How can I change the axis titles of a plot generated with rCharts and the dimple.js library? For example: library(rCharts) data(mtcars) mtcars.df <- data.frame( car = rownames(mtcars), mtcars ) d1 <- dPlot(x ="disp", y="mpg", groups=c("car", "cyl"), type ="point", data=mtcars.df) d1$xAxis( type = "addMeasureAxis") d1 The desired effect is to replace the variable name "disp" with a more complete piece of text as the axis title. I've tried adding arguments to the d1$xAxis() line like title=

Create a combined bar/line chart with dimplejs and use self-defined colors

痞子三分冷 提交于 2019-12-22 14:07:18
问题 I'm trying to create a combined bar/line chart based on a simple data set (columns: countries, index1, index2, index3, ...) using dimplejs. Index1 will be the bar chart and index2 upwards should be dynamically (=adding and removing indices per user interaction) displayed as line charts on top. I found out that I seemingly needed to create a hidden 2nd x-axis for the line graphics. Is there any other way? I was also unable to add more than one index as line chart. Is there a way to add more

How do you reduce the number of Y-axis ticks in dimple.js?

余生颓废 提交于 2019-12-19 03:22:42
问题 In dimple.js is there a way to, for example, reduce the number of y-axis ticks by half so that it would only show every other y tick instead of all of them? 回答1: You can modify it after draw with some d3. Here is a method which will remove the labels leaving every nth one: // Pass in an axis object and an interval. var cleanAxis = function (axis, oneInEvery) { // This should have been called after draw, otherwise do nothing if (axis.shapes.length > 0) { // Leave the first label var del = 0; /