@Override
  public Dataset createChart(final Document doc) {
    if (actionPath != null) { // if we have a solution then get the values
      values = getActionData();
    } else {
      // TODO support other methods of getting data
    }

    if (values == null) {
      // we could not get any data
      return null;
    }
    // get the chart node from the document
    Node chartAttributes =
        doc.selectSingleNode("//" + AbstractChartComponent.CHART_NODE_NAME); // $NON-NLS-1$
    // create the definition
    TimeSeriesCollectionChartDefinition chartDefinition =
        new TimeSeriesCollectionChartDefinition(
            (IPentahoResultSet) values, byRow, chartAttributes, getSession());

    // set the misc values from chartDefinition
    setChartType(chartDefinition.getChartType());
    setTitle(chartDefinition.getTitle());

    // get the URL template
    Node urlTemplateNode =
        chartAttributes.selectSingleNode(AbstractChartComponent.URLTEMPLATE_NODE_NAME);
    if (urlTemplateNode != null) {
      setUrlTemplate(urlTemplateNode.getText());
    }

    // get the additional parameter
    Node paramName2Node = chartAttributes.selectSingleNode(AbstractChartComponent.PARAM2_NODE_NAME);
    if (paramName2Node != null) {
      seriesName = paramName2Node.getText();
    }

    if ((chartDefinition.getWidth() != -1) && (width == -1)) {
      setWidth(chartDefinition.getWidth());
    }
    if ((chartDefinition.getHeight() != -1) && (height == -1)) {
      setHeight(chartDefinition.getHeight());
    }

    return chartDefinition;
  }