Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Image Added

图1:SQL图表属性

名称描述
自定义ID

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

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

独特的领域

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

标签菜单标签。必填项。
图表类型
  • 面积图
  • 条形图
  • 泡沫图表
  • 烛台图表
  • 甜甜圈图表
  • 折线图
  • 打开高低关闭图表(OHLC图表)
  • 饼形图
  • XY图表
图表标题图表标题将显示在生成的图形的一部分。

Image Added

图2:SQL图表属性 - 图表选项

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

字符宽度。

Code Block
title
100%
高度 

字符高度。

Code Block
title
300像素
颜色

系列颜色。可选字段。

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

例如

Code Block
title
 #3333FF,#66FF00,#FF9933,#990000
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

Code Block
titleExample
red,orange,yellow,green,blue,indigo红,橙,黄,绿,蓝,靛

Info
titleWhat are the default colors?什么是默认颜色?

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

Figure 3: SQL Chart Properties 图3:SQL图表属性 - SQL

Name名称Description描述
SQL QuerySQL查询 

SQL Query to produce the dataset required for the graph type.Query来生成图表类型所需的数据集。

Info

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

数据集中的第一列将假定为X轴/标签。

例1: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

Figure 4: SQL Chart Properties 图4:SQL图表属性 - UI

Name名称Description描述
Custom HeaderCustom Header in HTML.
Custom FooterCustom Footer in HTML.

Figure 5: SQL Chart Properties - Advanced

自定义标题HTML中的自定义标题。
自定义页脚HTML中的自定义页脚

图5:SQL图表属性 - 高级

名称描述
数据源
  • 默认数据源
  • 自定义数据源
如果选择默认数据源,则下面的自定义JDBC设置将被忽略。
用户视图键名称

定义时,将使用此处定义的值作为参数,并使用userview键值作为值附加附加条件。

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

:SELECT类别,计数(类别)FROM table1

用户视图键名称:类型

用户视图键值:val

结果SQL:SELECT类别,计数(类别)FROM 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.当定义userview键值时,您可以在您的SQL查询中定义#userviewKey# ,使其替换为userview键值。

Info
titleExample

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

Userview Key Value: val

用户视图键值:val

结果SQL:SELECT类别,计数(类别)FROM Resultant SQL:  SELECT category, count(category) FROM table1 WHERE type ='val'

Interactive Chart

交互式图表

下面的代码可以修改并放在交互式Chart的“Custom Footer”中。The following code can be modified and put in "Custom Footer" for interactive Chart.

Code Block
<script>
$(document).ready(function()<SCRIPT>
$(文件)。就绪(函数(){
    $( $('#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.