dimple.js

dimplejs - Toggling the display of a series selectively

拈花ヽ惹草 提交于 2019-12-11 23:44:11
问题 To the Word-Awesomeness example in dimplejs documentation, I have added 2 series with dimple.plot.bar and dimple.plot.line plotFunctions as shown below: Chart with 2 series: <head> <script src="http://d3js.org/d3.v3.min.js"></script> <script src="http://dimplejs.org/dist/dimple.v2.1.0.min.js"></script> </head> <body> <script type="text/javascript"> var svg = dimple.newSvg("body", 800, 600); var data = [ { "Word":"Hello", "Awesomeness":2000 }, { "Word":"World", "Awesomeness":3000 } ]; var

dimple.js: filter data, but not legend

。_饼干妹妹 提交于 2019-12-11 20:58:06
问题 I'm trying to draw a chart with a series added, and an interactive legend, but I want the chart to load with data filtered down to only one option in the legend. This would look like this but with only one option selected in the legend at load time. Once the chart is drawn I have modified the legend logic to toggle between datasets like radio buttons. Here is the code drawing the chart: var data = $rootScope._diskUtilization[$scope.myOption]; var svg = dimple.newSvg("#disk-utilization-chart

Dimple Time Format Juggling

假装没事ソ 提交于 2019-12-11 12:24:06
问题 I am very confused by the way dates are handled by dimple (or maybe it is just D3). My problem can be divided in two questions: My dates come as a column in my csv file in the format %Y-%m-%d %H:%M:%S . In order to convert them to date objects, I currently use the same loop I used to have in "vanilla" d3. data.forEach(function (d) { var format = d3.time.format("%Y-%m-%d %H:%M:%S"); d.Date = format.parse(d.Date); }); Is there a quicker way to do this with? Maybe with the timeField function? Or

how to start stacked bars from a negative value?

陌路散爱 提交于 2019-12-11 10:47:58
问题 I am trying to create a stacked bars chart in dimple.js with the stacked bar starting from a negative position. Is there any property of the chart that does this or is there any tweak that we can put into dimple.js file? 回答1: That's a slightly unusual requirement and dimple doesn't support it as a simple property, however you can create the impression of a bar starting below zero by using a fake axis. Here's an example with accompanying fiddle to show what I mean: var svg = dimple.newSvg("

How to color different data sets with different colors in dimple.js

半世苍凉 提交于 2019-12-11 02:47:41
问题 I am using another post's data and dimple.js script: Multi-series in dimplejs If you use the original unhacked data in that post, how do you color profit and revenue differently, that is, how can you use two different colors for y1 and y3? It seems like dimple does not support this, by sheer philosophy. 回答1: Restructuring the data as in that answer is not required with newer versions of dimple because of the introduction of composite axes. It could now be achieved like this: var svg = dimple

rCharts plot won't appear in shiny app using dimple.js

好久不见. 提交于 2019-12-10 13:01:08
问题 I came along with this problem, that rCharts plot won't show in my shiny app. I found this example which perfectly suits my needs. Even though this chart works perfectly while just plotting in R, in shiny it is an blank page. I am not sure what is wrong with it. Firstly, I am not sure if I am choosing right library in showOuput() , but I didn't find any better solution. I am trying to plot it more sophisticated app, however, I reproducing my simple app code below of server: server.R library

cleaning axis in dynamic charts in dimple.js

穿精又带淫゛_ 提交于 2019-12-08 04:03:58
问题 I'm using the clean axis function courtesy of @JohnKiernander. This works fine with static charts. But when I have a chart that updates (in this example when a button in clicked), the clean axis function does not work as expected. The function also erases others numbers of the axis. Is there a way to make this function work with dynamic charts? or do I have to take another approach? See fiddle: http://jsfiddle.net/jdash99/oba54L1a/ for a better explanation. // Clean Axis Function for

Dimple.js multi series bar not stacked

*爱你&永不变心* 提交于 2019-12-07 18:16:17
问题 Here is sample code... var svg = dimple.newSvg("#chartContainer", 600, 400), chart = null, s1 = null, s2 = null, x = null, y1 = null, y2 = null, data = [ { "ID" : "1", "Value 1" : 100000, "Value 2" : 110000 }, { "ID" : "2", "Value 1" : 90000, "Value 2" : 145000 }, { "ID" : "3", "Value 1" : 140000, "Value 2" : 60000 } ]; chart = new dimple.chart(svg, data); x = chart.addCategoryAxis("x", "ID"); y1 = chart.addMeasureAxis("y", "Value 1"); y2 = chart.addMeasureAxis("y", "Value 2"); s1 = chart

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

我们两清 提交于 2019-12-06 08:53: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 lines where each one is based on a column (index2, index3, ...)? Defining colors was another problem: The

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

守給你的承諾、 提交于 2019-12-06 06:04:17
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="Displacement" and label="Displacement: but without success. Sorry I just saw this. Thanks John for