google charts dashed line between interpolateNulls

809 views
Skip to first unread message

Johan Byrén

unread,
Jan 15, 2016, 6:02:17 AM1/15/16
to Google Visualization API

I use Google Charts Line chart and have implement interpolateNulls = true. This works great but now I want the line that interpolateNulls draws to be dotted.

Is it possible to set lineDashStyle: [4,4] just on the interpolateNulls? Here is some of my code:


    var drawChart = function (data, type, firstIsAverage, vAxisHeader) {
    var shift = (firstIsAverage === true) ? 0 : 1;

    var fontname = 'Roboto';
    var fontsize = 14;

    var chartObject = {
        type: type,
        display: false,
        data: data,
        options: {
            chartArea: {
                left: 100, 
                top: 30,
                width: 800,
                height: 240
            },
            vAxis: {
                title: vAxisHeader,
                titleTextStyle: {
                    italic: false
                }
            },
           // lineDashStyle: [4, 4],     //Just want this on the interpolateNulls
            interpolateNulls: true,      //Here is the interpolate
            fontName: fontname,
            fontSize: fontsize,
            legend: 'none',
            colors: colors.slice(shift),
            isStacked: "true",
            fill: 20,
            displayExactValues: false
        },
        formatters: {}
    };
    setAllColumnsVisible(chartObject);

    return chartObject;
};

Sergey Grabkovsky

unread,
Jan 15, 2016, 9:40:08 AM1/15/16
to Google Visualization API
Hi Johan,

Sadly, we don't yet support the lineDashStyle at that kind of granularity.

However, you can change other aspects of the style. For example, you could change the color to make those parts gray, or change the opacity of those parts, or both. This can be accomplished with the style role. However, you will have to add another column to your chart, and explicitly make the right rows have the correct values. Here's an example of this: http://jsfiddle.net/xk0r4zne/

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/490b159c-9a45-4af1-a02f-42322cf07e4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

unnamed.gif

Sergey Grabkovsky

Software Engineer

Google, Inc

gra...@google.com


Reply all
Reply to author
Forward
0 new messages