Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
borderColorgreen
borderWidth1
titleBGColor#ddffcc
borderStylesolid
titleDefinition

图表SQL图表) 为您提供了另一种报表媒体。您可以灵活地定义自己的SQL查询,以确定您想要生成的图表,从多种图表类型。


Image Added

图1:SQL图表属性

名称描述
自定义ID

物品链接slu </s>。可选字段。

Info
title独特的领域

在这里定义的值必须是唯一的用户视图菜单的其余部分,因为第一个匹配的名称将被调用。

标签菜单标签。必填项。
图表类型
  • 面积图
  • 条形图
  • 泡沫图表
  • 烛台图表
  • 甜甜圈图表
  • 折线图
  • 打开高低关闭图表(OHLC图表)
  • 饼形图
  • XY图表
图表标题

图表标题将显示在生成的图形的一部分。

Panel
borderColorpurple
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

This feature has been enhanced in Joget Workflow v6 to support join, group and aggregate function.

Image Added

图2:SQL图表属性 - Datasource

名称描述
Datasource
  • Using Data Binder
  • Default Datasource
  • Custom Datasource
Panel
borderColorpurple
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

New feature in Joget Workflow for more flexible ways to build chart dataset using the existing Datalist Binders.

Data Binder

When Datasource is set to "Using Data Binder", this option will show up.

Please see Datalist Binder for available binder to use.

SQL查询 

When Datasource is set to use any of the "Datasource", this option will show up.

SQL Query来生成图表类型所需的数据集。

Info

数据集中的第一列将假定为X轴/标签, followed by value columns for the Y-axis.

例1:

Code Block
title

SQL Chart equips you with another medium of reporting by using charts. You are given the flexibility of defining your own SQL query to determine the charts that you would like to generate, ranging from a number of graph types.

Image Removed

Figure 1: SQL Chart Properties

NameDescription
Custom ID

Item link slug. Optional field.

Info
titleUnique field

Value defined here must be unique to the rest of the Userview Menus as the first matching name will be called upon.

LabelMenu label. Mandatory field.
Chart Type
  • Area Chart
  • Bar Chart
  • Bubble Chart
  • Candlestick Chart
  • Donut Chart
  • Line Chart
  • Open High Low Close Chart (OHLC Chart)
  • Pie Chart
  • XY Chart
Chart TitleChart Title to be displayed part of the generated graph.

Image Removed

Figure 2: SQL Chart Properties - Chart Options

NameDescription
X-axis Label 
X-axis Label 
X-axis display as
  • Category
  • Number
  • Date
Y-axis Label 
Y-axis Label 
Y-axis Prefix
Y-axis Prefix
Show Legend?
If checked, legend will be shown in the generated graph.
Show Value Label in Chart?
If checked, value label will be shown in the generated graph.
Width 

Width in character.

Code Block
titleExample
100%
Height 

Height in character.

Code Block
titleExample
300px
Colors

Series color. Optional field.

Comma separated values (CSV) of color codes.

Example:

Code Block
titleExample
 #3333FF,#66FF00,#FF9933,#990000

Image Removed

Code Block
titleExample
red,orange,yellow,green,blue,indigo

Image Removed

Info
titleWhat are the default colors?

http://stackoverflow.com/questions/18332440/what-are-the-jqplot-default-series-colors

Figure 3: SQL Chart Properties - SQL

NameDescription
SQL Query 

SQL Query to produce the dataset required for the graph type.

Info

The first column in the dataset will be assumed for X-axis/label.

Example 1:

Code Block
titleExample
SELECT c_status as 'status', COUNT(c_status) as ,COUNT(c_status)as'count' FROM app_fd_tix_tickets WHERE c_status IS NOT NULL GROUP BY c_status

Example 2:例2:

Code Block
titleSQL
select c选择c.c_claimant, sum( cast( replace(cclaimant,sum(cast(替换(c.c_total,total,'$', '') as decimal(10,2)) ) as 'total', avg( cast( replace(c.c_total,'$', '') as decimal(10,2)) ) as 'avg' from app)为十进制(10,2)))为'total',avg(cast(replace(c.c_total,'$' '')作为十进制(10,2)))作为'平均'从app_fd_hr_expense_claim c group by cc组由c.c_claimant

Image Added

Figure 43: SQL Chart Properties - UI- Data Binder & Chart Data Mapping (applicable for - using Data Binder)

NameDescription
Custom HeaderCustom Header in HTML.
Custom FooterCustom Footer in HTML.
Order ByColumn to be sorted in the graph dataset. This would affect how the graph is plotted.
Order
  • ASC
  • DESC
X-axis Value 
X-axis label. 
Y-axis Values
Y-axis dataset.

Image Added

图4:SQL图表属性 - 图表选项 (applicable for - using Datasource)

名称描述
X轴标签 
X轴标签 
X轴显示为
  • 类别
  • 日期
Y轴标签 
Y轴标签 
Y轴前缀
Y轴前缀
显示传奇?
如果选中,图例将显示在生成的图表中。
在图表中显示值标签?
如果选中,则值标签将显示在生成的图形中。
宽度 

字符宽度。

Code Block
title
100%
高度 

字符高度。

Code Block
title
300像素
颜色

系列颜色。可选字段。

颜色代码的逗号分隔值(CSV)。

例如

Code Block
title
 #3333FF,#66FF00,#FF9933,#990000

Image Added

Code Block
titleExample
红,橙,黄,绿,蓝,靛

Image Added

Info
title什么是默认颜色?

http://stackoverflow.com/questions/18332440/what-are-the-jqplot-default-series-colors

Image Added

Figure 5: SQL Chart Properties - Advanced

NameDescription
Datasource
  • Default Datasource
  • Custom Datasource
If the default datasource is selected, the custom JDBC settings below will be ignored.
Userview Key Name

When defined, additional condition will be appended using the value defined here as the parameter and the userview key value as the value.

Info
titleExample

SQL: SELECT category, count(category) FROM table1

Userview Key Name: type

Userview Key Value: val

Resultant SQL:  SELECT category, count(category) FROM table1 WHERE type = 'val'

When userview key value is defined, you may define #userviewKey# in your SQL query to have it replaced with the userview key value.

Info
titleExample

SQL: SELECT category, count(category) FROM table1 WHERE type = '#userviewKey#'

Userview Key Value: val

Resultant SQL:  SELECT category, count(category) FROM table1 WHERE type = 'val'

Interactive Chart

The following code can be modified and put in "Custom Footer" for interactive Chart.

Custom Header
Custom Header in HTML.
Custom Footer
Custom Footer in HTML.

交互式图表

下面的代码可以修改并放在交互式Chart的“Custom Footer”中。

Code Block
<SCRIPT>
$(文件)。就绪(函数()
Code Block
<script>
$(document).ready(function(){
    $( $('#jq#jq_plot_chart').bind()。绑定( 'jqplotDataClick',
        function (event, seriesIndex, pointIndex, data) 函数(event,seriesIndex,pointIndex,data){   
            console.log(event)的console.log(事件);
            console.log(seriesIndex)的console.log(seriesIndex);
            console.log(pointIndex)的console.log(pointIndex);
            console.log(data)的console.log(数据);
            
            //for chart which used legend and x-axis, 对于使用图例和x轴的图表, 
            var xaxis = $(".jqplot$(“。jqplot-xaxis-tick:eq("tick:eq(”+ pointIndex +")")“)”);
            var series = $(".jqplot$(“。jqplot-table-legend-label:eq("label:eq(”+ seriesIndex +")")“)”);
            
            console.log("x-axis :" log(“x-axis:”+ xaxis.text())text());
            console.log("series :" log(“series:”+ series.text())text());
        }
    );
 
    //for double click event. Please note the arguments are different.
    $('#jq /双击事件。请注意,论据是不同的。
    $( '#jq_plot_chart').bind()。绑定( 'jqplotDblClick',
        function (event, coordinate, points, data) 功能(事件,坐标,点数据){   
            console.log(event)的console.log(事件);
            console.log(coordinate)的console.log(坐标);
            console.log(points)的console.log(分);
            console.log(data)的console.log(数据);

            if (data) 如果(数据){
                var xaxis = $(".jqplot$(“。jqplot-xaxis-tick:eq("tick:eq(”+ data.pointIndex +")")“)”);
                var series = $(".jqplot$(“。jqplot-table-legend-label:eq("label:eq(”+ data.seriesIndex +")")“)”);

                console.log("values :" log(“values:”+ data.data)data);
                console.log("x-axis :" log(“x-axis:”+ xaxis.text())text());
                console.log("series :" log(“series:”+ series.text())text());
            }
        }
    );
});
</script> SCRIPT>
Note

 This code does not work with OHLC and candlestick chart. 此代码不适用于OHLC和烛台图表。

Panel
borderColorpurple
borderWidth1
titleBGColor#ddccff
borderStylesolid
titlePerformance性能

您可以在此UserView元素中配置“ 性能”设置,以允许缓存现有内容以提高性能和加载速度。使用Userview缓存进行性能改进,了解更多信息。You can configure the Performance settings in this Userview Element which allows one to cache existing content for improved performance and loading speed. Read more at Performance Improvement with Userview Caching.