This commit is contained in:
JohnYan 2021-03-27 11:05:15 +08:00
parent 1074e1b9ae
commit 6d6d8b6ffd
12 changed files with 62 additions and 23 deletions

View File

@ -107,6 +107,7 @@
- [Smartchart与Pandas](https://www.ixigua.com/6910413586208653837?id=6918162479646245389 "smartchart")
- [Smartchart与Jupyter](https://www.ixigua.com/6910413586208653837?id=6917989046132310535 "smartchart")
- [SmartChart大屏新思路](https://www.ixigua.com/6921133676189352456 "smartchart")
- [SmartChart的Python连接器](https://www.ixigua.com/6944159294069670437 "smartchart")
```python
from smart_chart.common.tools import Smart
@ -176,12 +177,13 @@ pip install smartchart
### 数据库支持说明
- 原生支持的有mysql,sqlite,API,EXCEL数据
- 原生支持的有mysql,sqlite,API,EXCEL数据, 你可以使用python连接器扩展任意数据源
- SQL Server 需安装 pip install pymssql
- ORACLE 需安装 pip install cx_Oracle
- GP,Postgrep 需安装 pip install psycopg2
- Impala 需安装 pip install impyla
- DB2 需安装 pip install ibm_db
- Python 需安装 pip install pandas, openpyxl
- ....
### 联系我们与帮助
@ -227,6 +229,7 @@ v3.9.8.23 Echarts升级5.0.1, 支持一个数据集对应多查询, 资源本
v3.9.9.0 print函数优化,新增数据透视函数,个人静态资源路径显示, db2支持
v3.9.9.1 开发界面美化
v3.9.9.5 开发界面优化,fix定时刷新BUG,新增批量数据集删除
v3.9.9.7 增加python连接器,数据池,自定义主模板,优化开发界面
```
-------------------------------------------------------------------------------

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,10 +2,11 @@ var __dataset__ = [['category','C1','C2'],['L1',10,20],['L2',15,25],['L3',8,15]]
var logstr='';
var helpText = '';
var vapp = {};
function print(item){logstr+=item+";"};
var autoshow = true;
function print(item){logstr+=item+";"}
function GetQueryString(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
@ -145,6 +146,7 @@ var appEnv = {},
window.setTimeout = function(e, t) { var o = _oldSetTimeout(e, t); return _timeoutIdList.push(o), o }, window.setInterval = function(e, t) { var o = _oldSetInterval(e, t); return _intervalIdList.push(o), o };
var _events = [],
run = function(ignoreOptionNotChange) {
if(!(autoshow || ignoreOptionNotChange)){return}
// var dom = document.getElementById("chart-panel");
if (gb.chart || (gb.chart = echarts.init(dom, configs.theme, { renderer: configs.renderer || "canvas" }), _wrapOnMethods(gb.chart)), hasEditorError()) return void log(lang.errorInEditor, "error");
// if (gb.chart || (gb.chart = echarts.init($("#chart-panel")[0], configs.theme, { renderer: configs.renderer || "canvas" }), _wrapOnMethods(gb.chart)), hasEditorError()) return void log(lang.errorInEditor, "error");
@ -192,4 +194,8 @@ var _events = [],
},
runDebounce = _.debounce(run, gb.debounceTime, { trailing: !0 });
$("#save").click(serverSave);
$("#code-toggle-button").click(editorShowSet);
$("#code-toggle-button").click(editorShowSet);
function auto_html() {
autoshow = !autoshow;
if(autoshow){$('#id_autohtml').css('color', 'red')}else{$('#id_autohtml').css('color', 'gray')}
}

View File

@ -90,7 +90,7 @@ $('#title').click(function () {
$('#conn').click(function () {
$.ajax({type: "get",url: '/echart/get_connlist/',success: function (data){
let connselect = $('#connselect');console.log(data['msg']);
let connselect = $('#connselect');connselect.empty();
data['msg'].forEach(function (item) {
connselect.append('<option value='+item[0]+'>'+item[1]+'</option>')
});

View File

@ -49,7 +49,7 @@ $('#title').click(function () {
$('#conn').click(function () {
$.ajax({type: "get",url: '/echart/get_connlist/',success: function (data){
let connselect = $('#connselect');console.log(data['msg']);
let connselect = $('#connselect');connselect.empty();
data['msg'].forEach(function (item) {
connselect.append('<option value='+item[0]+'>'+item[1]+'</option>')
});

View File

@ -2,7 +2,7 @@
.table th, .table td {text-align: center;}
.table {font-size:10px;}
.devspan {position:absolute;z-index:99999;}
.devspan:hover a, .devhead:hover select, .devhead:hover a {display: initial;}
.devspan:hover a, .devhead:hover select, .devhead:hover a .show{display: initial;}
.devspan a, .devhead select, .devhead a, .hidden {display: none}
.devhead {background:white;position:fixed;z-index:99998;}
@ -32,5 +32,5 @@
{{footer|safe}}{% block javascript %}{% endblock %}
<script>function print(item){console.log(item)};$("#smartcharthead").on("click",function(){if($("#id_devhead").hasClass('devhead')){$("#id_devhead").removeClass('devhead');}else{$("#id_devhead").addClass('devhead')}});{% if dv %}var vapp = new Vue({el: '#vue_app', data: {d0:'',d1:'',d2:'',d3:'',d4:'',d5:'',d6:'',d7:'',d8:'',d9:'',d10:'',d11:'',d12:'',d13:'',d14:'',d15:'',d16:''}});{% endif %}var app = {};var charts = [];{{echart_main|safe}}window.onresize = function(){for(var i = 0; i < charts.length; i++){charts[i].resize();}};
$(function(){$("#fullScreen").on("click",function(){var isFull=!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement);if(isFull===false){fullScreen()}else{exitFullscreen()}})});function fullScreen(){var element=document.documentElement;if(element.requestFullscreen){element.requestFullscreen()}else if(element.msRequestFullscreen){element.msRequestFullscreen()}else if(element.mozRequestFullScreen){element.mozRequestFullScreen()}else if(element.webkitRequestFullscreen){element.webkitRequestFullscreen()}}function exitFullscreen(){if(document.exitFullscreen){document.exitFullscreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}}
</script>
$(".devspan span").on("click",function(){let devspana=$(".devspan a");if(devspana.hasClass('show')){devspana.removeClass('show')}else{devspana.addClass('show')}})</script>
<!--powered by smartchart.cn,Designed by JohnYan mailto:84345999@qq.com, https://gitee.com/smartchart/smartchart you need keep this-->

View File

@ -0,0 +1,19 @@
{% extends "echart/base.html" %}
{% block head %}{% endblock %}
{% block style %}{% endblock %}
{% block stylesheet %}{% endblock %}
{% block body %}
<body {{body|safe}}>
<div class="container_fluid">
<div class="row_fluid" id="vue_app">
{% for div in div_list %}
{{div|safe}}
{% endfor %}
</div>
</div>
</body>
{% endblock %}
{% block javascript %}<script type="text/javascript" src="/static/echart/dist/extension/echarts-liquidfill.min.js"></script>
<script type="text/javascript" src="/static/echart/dist/extension/ecStat.min.js"></script>
<script type="text/javascript" src="/static/echart/dist/extension/echarts-wordcloud.min.js"></script>{% endblock %}

View File

@ -0,0 +1,10 @@
{% extends "echart/base.html" %}
{% block head %}{% endblock %}
{% block style %}{% endblock %}
{% block stylesheet %}{% endblock %}
{% block body %}
{% for div in div_list %}
{{div|safe}}
{% endfor %}
{% endblock %}
{% block javascript %}{% endblock %}

View File

@ -40,6 +40,8 @@
data-target="#myModal_reset"></a>
<a class="glyphicon glyphicon-question-sign" title="帮助" href="#"
style="color: rgb(155, 205, 60);float:right" onclick="load_help('help_divlist')"></a>
<a class="glyphicon glyphicon-certificate" title="开启实时调试" id="id_autohtml" href="#"
style="color: gray;float:right" onclick="auto_html()"></a>
<pre id="editor1" class="edit-area"></pre>
</div>
</div>
@ -48,7 +50,7 @@
</div>
</div>
</div>
<div class="col-xs-12 col-md-5" style="padding:0.1% 0.1%;" id="preview"></div>
<div class="col-xs-12 col-md-5" style="padding:0.1% 0.1%;" id="preview">点击上方太阳标识可开启实时调试</div>
</div>
</div>
@ -87,6 +89,7 @@
<script type="text/javascript">
editor1=init_editor('html');
editor1.setValue(`{{div_str|safe}}`);
var autoshow = false;
$('#submit').click(function () {
let e = editor1.getValue();
console.log(e);
@ -109,7 +112,7 @@
});
});
editor1.getSession().on('change', function (e) {
$("#preview").html(editor1.getValue());
if(autoshow){$("#preview").html(editor1.getValue());}
$("#printlog").html('');
});
@ -127,6 +130,10 @@ function reset_seq(){
}
}
})}
function auto_html() {
autoshow = !autoshow;
if(autoshow){$('#id_autohtml').css('color', 'red')}else{$('#id_autohtml').css('color', 'gray')}
}
</script>
</body>
</html>

View File

@ -76,7 +76,9 @@
//加载自定义CSS
"js":["/static/custom/xx","xxxx"],
//开启datav和vue模式
"dv":1</pre>
"dv":1
//自定义模板文件
"template":"common2.html"</pre>
自定义静态资源文件路径:<br>{{ spath }}
</div>
</div>