ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
#### 添加柱状图 ~~~ //>具体查看iframe->chart图表类->stack柱状图 $stack_id = 'stack1'; //>柱状图ID $obj = []; $obj['title'] = '我是标题'; //>标题 $obj['label'] = 'glyphicon glyphicon-list-alt'; //>图标 //>数据添加 $data = []; $data[] = [[1,2],[2,3],[3,4],[4,4],[5,6],[6,6],[7,7]]; $data[] = [[1,1],[2,2],[3,3],[4,4],[5,6],[6,6],[7,7]]; $sbh_charts[] = $I_C->stack($stack_id, $data, $obj); ~~~ #### 添加曲线图 ~~~ //>具体查看iframe->chart图表类->points曲线图 $points_id = 'points1'; //>图标标识 $obj = []; $obj['title'] = '我是标题'; //>标题 $obj['label'] = 'glyphicon glyphicon-list-alt'; //>图标标识 $obj['x_id'] = 'x1'; //>动态X轴值显示框标识 $obj['y_id'] = 'y1'; //>动态Y轴值显示框标识 //>XY轴设置 $obj['xaxis'] = 'ticks:[[1, "1点"], [2, "2点"], [3, "3点"], [4, "4点"], [5, "5点"], [6, "6点"], [7, "7点"], [8, "8点"], [9, "9点"], [10, "10点"], [11, "11"], [12, "12点"], [13, "13点"], [14, "14点"], [15, "15点"], [16, "16点"], [17, "17点"], [18, "18点"], [19, "19点"], [20, "20点"], [21, "21"], [22, "22点"], [23, "23点"], [24, "24点"]]'; $obj['yaxis'] = 'min:0,max:30'; //>2条曲线数据添加 data为数据 label为数据标签 color为曲线颜色 $data = []; $data[] = ['data'=>[[1,2],[2,1],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8],[9,9],[10,10],[11,11],[12,12],[13,13],[14,14],[15,15],[16,16],[17,17],[18,18],[19,19],[20,20],[21,21],[22,22],[23,23],[24,24]],'label'=>'test1','color'=>'"#539F2E"']; $data[] = ['data'=>[[1,2],[2,1],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8],[9,9],[10,10],[11,11],[12,12],[13,13],[14,14],[15,15],[16,16],[17,17],[18,18],[19,19],[20,20],[21,21],[22,22],[23,23],[24,24]],'label'=>'test2','color'=>'"#3C67A5"']; $sbh_charts[] = $I_C->points($points_id, $data, $obj); ~~~ #### 添加饼状图 ~~~ //>具体查看iframe->chart图表类->pie饼状图 $pie_id = 'pie1'; //>饼状图标识 $obj = []; $obj['title'] = '我是标题'; //>标题 $obj['label'] = 'glyphicon glyphicon-list-alt'; //>图标 //>数据添加 $data = []; $data[] = ['label'=>'周一[7]','data'=>'7']; $data[] = ['label'=>'周二[2]','data'=>'2']; $data[] = ['label'=>'周三[3]','data'=>'3']; $data[] = ['label'=>'周四[5]','data'=>'5']; $data[] = ['label'=>'周五[4]','data'=>'4']; $data[] = ['label'=>'周六[6]','data'=>'6']; $data[] = ['label'=>'周日[1]','data'=>'1']; $sbh_charts[] = $I_C->pie($pie_id, $data, $obj); //> ~~~