Hi - great module!

I need to be able to graph progressive sales vs target, so the actuals time series will only have partial data at any one time.
Currently my graph won't show at all if I use null value, and zero values looks ugly - e.g. sales go up then drop to zero and flatline for the remainder of the period.

I am replacing a report in MSSQLServer - people's expectation (e.g.based on std Microsoft charts) is that it is possible to chart 2 series of different 'lengths', that null are simply ignored.I can't find anything in the SVGChart site or past Forena issues or videos to help.

Is there some FRX that can process null or hide 0 values?
Is there a method of combining 2 data blocks - overlaying them on the same axes?

Any help would be appreciated.

CommentFileSizeAuthor
#6 nullgraphvalues-2347311-6.patch2.71 KBmetzlerd
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MickC’s picture

Issue summary: View changes
metzlerd’s picture

In the current development branch there are some new features that may help, depending on what your data structures look like. If you think you can develop a data block that returns data like #2337327: Multilinegraph using FrxCrosstab, then there maybe some help in the latest release for you. If not I need to know a little more about your data structure and your SQL query.

MickC’s picture

Thanks for the quick reply - the issue is a bit different to that other post - probably best illustrated with some ample data:

  • Imagine we are 7 weeks into the quarter
  • we want to show progressive actual sales vs target
  • the graph should have 13 data points for the target but only 5 for actual

Week Target Actual
W1 1000 1019
W2 2000 1990
W3 3000 3141
W4 4000 3775
W5 5000 4833
W6 6000 6395
W7 7000 6977
W8 8000
W9 9000
W10 10000
W11 11000
W12 12000
W13 13000

metzlerd’s picture

Yes that helps... let me work on a patch for this problem. I think it's reasonable to assume in this case that null is not the same as zero, and that null values should be ignored.

MickC’s picture

Thanks David, that's great. Do you think it's going to be achievable with SVGGraph?
Given the graph won't render at all currently with NULL values, I tried but couldn't see any frx options anywhere for how to handle NULL.

If you can solve that then great, otherwise that's why I was asking whether it's possible to overlay 2 graphs on the same axes.
That option might have the advantage of being able to overlay different chart types as well e.g. line superimposed over a column chart.

First things first however...

metzlerd’s picture

Version: 7.x-4.0-beta3 » 7.x-4.x-dev
Category: Support request » Bug report
Priority: Critical » Major
FileSize
2.71 KB

Here is a patch that was rolled against the current dev branch. The SVG graphing options were significantly updated so you will need to get 7.x-4.x-dev to before applying this patch.

There is no method of combining two data blocks on the same graph currently. That would be interesting I suppose but quite difficult to achieve, and would have still had the same problems in the existing code which was zeroing out null values because PHP graph didn't like them.

Anyway this patch will solve your problem and be committed shortly.

  • metzlerd committed dc9fe7b on 7.x-4.x
    #2347311 Hide null values in graphs.
    
metzlerd’s picture

Status: Active » Fixed
metzlerd’s picture

Version: 7.x-4.x-dev » 7.x-4.0-beta4

FYI this is now fixed in beta 4 release.

MickC’s picture

Brilliant! Thanks David, great result and fast turnaround.

The other comment was really about 'Mixed' or 'Combination' graphs e.g. Bar and Line, or Area and Line graphs.
e.g. https://developers.google.com/chart/interactive/docs/gallery/combochart

However this ticket is resolved so let's close this and I'll raise a new one about Combination charts.

  • metzlerd committed dc9fe7b on 7.x-4.x-features
    #2347311 Hide null values in graphs.
    

  • metzlerd committed dc9fe7b on 8.x-1.x
    #2347311 Hide null values in graphs.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.