Unfortunately the "value range" for vertical axis takes only the whole numbers and we really need to set maximum value to numbers like 1.5, 2.5 sometimes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ryantollefson’s picture

I'd add my vote to this.

Pierre.Vriens’s picture

Category: Bug report » Feature request
Pierre.Vriens’s picture

Component: Highcharts integration » Views integration

I just marked issue #2356085: "Decimal count" gets ignored for HC as a duplicate of this issue, which states the following:

"Enforce a certain number of decimal-place digits in displayed values" for vertical axis' "Decimal count" doesn't work. I am using Highcharts.

While reviewing that issue, I realized that "Enforce a certain number of decimal-place digits in displayed values" is exactly the description at the very bottom when using the Views UI, and editing the Style options (within "Vertical Axis"). To find a testcase for it, just edited the view related to the delivered examples (at charts/examples/views ).

However, in my case (that is one of the delivered examples at charts/examples/views ), I could perfectly edit it. Eg: change the value to 3 digits, or just leave it blank (auto). And in each of these cases I got the expected result ... I think. However I'm using GC (Google Charts) instead of HC (Highcharts).

So how to move forward with this issue? Can anybody provide some more feedback to answer these questions:

  1. Do you get the same results as mine, using the the delivered examples at charts/examples/views ?
  2. Should I use some other scenario to recreate this issue?
  3. Maybe the issue is that it works fine for GC but not for HC (which I haven't been able to verify yet)?

If we don't understand the problem (or feature request), we cannot fix it, right?

ryantollefson’s picture

FileSize
10.48 KB

I think the real issue here is the scale on the axis. It is currently impossible to have the axis start at 1.5, you must pick either 1 or 2. This doesn't always fit well for certain sets of data.

Pierre.Vriens’s picture

Ryan, thank you for the extra info in #4. With that info (and the screenprint you added), that 'issue' is perfectly clear to me now. However: your image relates to the horizontal axis, while the initial description is about vertical axis. So for the vertical axis I still don't understand the question (I do now for the horizontal axis).

Pierre.Vriens’s picture

While working on this issue, I realized some other (minor) issue related to charts/examples/views : the number of nodes shown in the column chart, have a prefix of "$" and suffix of "lbs". Obviously that's not quite right, but they are shown as such because of what is hardcoded in the charts code (for options related to yaxis_prefix and yaxis_suffix) as shown near this line: http://cgit.drupalcode.org/charts/tree/views/charts.views_default.inc#n104 . Also a bit strange (I think) is the hardcoded value (of 260) for yaxis_max ...

So here are my questions about this:

  1. What could be 1 good reason why they are hardcoded here? My guess is to just showcase a sample that includes some prefix/suffix, however for "nodes" that doesn't make sense at all.
  2. What would be a good sample of some type of data you have available in all Drupal sites (like you probably have nodes), and for which some prefix and/or suffix that makes sense?

I'm considering REMOVING these 3 hardcoded values, and eventually (if my question '2.' gets answered) add some other sample for which it makes sense to use such hardcoded values. Any arguments to not remove those 3 values?

ryantollefson’s picture

FileSize
9.87 KB

It could be either 'vertical' or 'horizontal' depending on the chart type (bar vs. column).

ryantollefson’s picture

I'm considering REMOVING these 3 hardcoded values, and eventually (if my question '2.' gets answered) add some other sample for which it makes sense to use such hardcoded values. Any arguments to not remove those 3 values?

Just to make sure I'm understanding... you're simply saying to remove those values, not the prefix/suffix options?
Assuming that; yeah, I don't see how there could be a good argument against it.

Pierre.Vriens’s picture

Reply to #8 above: yes, all I suggest doing is to replace those 3 hardcoded values to '', in the 3 lines I mentioned.

Pierre.Vriens’s picture

Title: Value range takes only whole numbers » 'Value range' takes only whole numbers
Status: Active » Needs work

Update about what I wrote in #3: with the images Ryan added to #4 and #7, I now realize that these are 2 separate issues. Therefor I've reopened issue #2356085: "Decimal count" gets ignored for HC, and added an extra comment there (in #4), what that issue seems to be about (+ updated the original issue description).

This issue is (only) about the 'Value Range', and applies for both GC and HC. The other issue is (only) about Decimal Count, and applies for only HC (it works fine for GC).

Now that we understand the problem, I'm updating the status accordingly. Anybody out there to submit the fix (patch) for it?

Pierre.Vriens’s picture