dongxun1244 2015-08-24 19:34
浏览 39
已采纳

OpenTBS / PHP - 如何在docx模板内部动态生成嵌入图的水平值?

I have a graph for which I was able to manually create x axis values in a docx template. The template outputs the correct graph. Instead of relying upon manually entering all x values and substituting the values from the php array, I want to dynamically populate the horizontal axis with values from a php array.

PHP Code

// --------------------------------------------
        // Merging and other operations on the template
        // --------------------------------------------
        // Change chart series
        $ChartNameOrNum = 'Buildup'; // Title of the shape that embeds the chart
        $SeriesNameOrNum = 'Series 1';
        $NewValues = array($buildupLabels['TotalActionItems'], $buildupSeries['TotalActionItems'] );
        $NewLegend = "Total Action Items";
        $TBS->PlugIn(OPENTBS_CHART, $ChartNameOrNum, $SeriesNameOrNum, $NewValues, $NewLegend);

        // Delete comments
        $TBS->PlugIn(OPENTBS_DELETE_COMMENTS);

Output File with Rendered Chart

Output Chart

Chart Template

BuildUp Template

Table of x-axis values

Manually Entered Values

How can I achieve the above? Is this possible using the OpenTBS, or do I need to manually enter all x axis values?

  • 写回答

2条回答 默认 最新

  • dprnr5559 2015-12-01 18:00
    关注

    I just discovered that I do not need to automatically generate all of the horizontal values in the embedded chart. All I need to do is put one date in the first record (e.g. Mar 05 15 or anything else not even in the range of dates I am populating) and the series will automatically populate all available dates from my PHP array.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)