OpenTBS chart 'Two charts in one' data structure advice needed

98 views Asked by At

I'm putting together a docx template which contains a number of graphs which can have their data changed using OpenTBS. I've successfully managed to do a few. One is giving me problems. It is a kind of 'two graphs in one' scenario. See screenshot. I've given the chart the title 'Susceptibility & Reporting by Time Over Time'. Can you even have two charts in one in this way? I've made a number of different attempts using the different array structures listed in the OpenTBS docs without any success. I am getting the error 'TinyButStrong Error OpenTBS Plugin: (ChartChangeSeries) 'Susceptibility & Reporting by Time Over Time' : unable change series 'Jan 2016 Campaign #1' in the chart 'chart15' : Name of the series not found. The process is ending, unless you set NoErr property to true'. See code. Thanks.enter image description here

$chartName = 'Susceptibility & Reporting by Time Over Time';
    $newLegend = false;
    $newValues = array(
        array(
            'Reported Email Correctly',
            'First Link Clicked / Attachment Run'
        ),
        array(180, 180)
    );
    $SeriesNameOrNum = 'Jan 2016 Campaign #1';
    $TBS->PlugIn(OPENTBS_CHART, $chartName, $SeriesNameOrNum, $newValues, $newLegend);

    $newValues = array(
        array(
            'Reported Email Correctly',
            'First Link Clicked / Attachment Run'
        ),
        array(140, 140)
    );
    $SeriesNameOrNum = 'April 2016 Campaign #2';
    $TBS->PlugIn(OPENTBS_CHART, $chartName, $SeriesNameOrNum, $newValues, $newLegend);

    $newValues = array(
        array(
            'Reported Email Correctly',
            'First Link Clicked / Attachment Run'
        ),
        array(100, 100)
    );
    $SeriesNameOrNum = 'Oct 2016 Campaign #3';
    $TBS->PlugIn(OPENTBS_CHART, $chartName, $SeriesNameOrNum, $newValues, $newLegend);

    $newValues = array(
        array(
            'Reported Email Correctly',
            'First Link Clicked / Attachment Run'
        ),
        array(80, 80)
    );
    $SeriesNameOrNum = 'Oct 2016 Campaign #4';
    $TBS->PlugIn(OPENTBS_CHART, $chartName, $SeriesNameOrNum, $newValues, $newLegend);

https://i.stack.imgur.com/6EmWk.png

1

There are 1 answers

0
jonnjo2005 On

I got it to work. In actual fact I was doing it right but you have to enter the $SeriesNameOrNum exactly how they appear in the embedded worksheets. So I found the relevant worksheet and copied and pasted the series name from there. They now include even the line breaks as per the worksheet i.e 'Jan 2016 Campaign #1' now has a line break after 2016.