Home > other >  Wxpython the webview control cannot display properly pyecharts generated HTML file, please help
Wxpython the webview control cannot display properly pyecharts generated HTML file, please help

Time:09-24


HTML enthusiast file

 & lt; ! DOCTYPE html> 


<meta charset="UTF-8">
Awesome - pyecharts


<body>

<script>
Var chart_bed301d616764f99a48cc355199d9d6c=echarts. Init (
Document. The getElementById (' bed301d616764f99a48cc355199d9d6c '), 'white' {the renderer: 'canvas'});
Var option_bed301d616764f99a48cc355199d9d6c={
"Animation" : true,
"AnimationThreshold" : 2000,
"AnimationDuration" : 1000,
"AnimationEasing" : "cubicOut,"
"AnimationDelay" : 0,
"AnimationDurationUpdate" : 300,
"AnimationEasingUpdate" : "cubicOut,"
"AnimationDelayUpdate" : 0,
"Color" : [
"# c23531,"
"# 2 f4554,"
"# 61 a0a8,"
"# d48265,"
"# 749 f83,"
"# ca8622,"
"# bda29a,"
"# 6 e7074,"
"# 546570",
"# c4ccd3,"
"# f05b72,"
"# ef5b9c,"
"# f47920,"
"# 905 a3d,"
"# fab27b,"
"# 2 a5caa,"
"# 444693",
"# 726930",
"# b2d235,"
"# 6 d8346,"
"# ac6767,"
"# 1 d953f,"
"# 6950 a1,"
"# 918597"
],
"Series" : [
{
"Type" : "bar",
"Name" : "\ u5546 \ u5bb6A,"
"Data" : [
114,
55,
27,
101,
125,
27,
105
],
"BarCategoryGap" : "20%",
"Label" : {
"The show" : true,
"The position", "top",
"Margin" : 8
}
},
{
"Type" : "bar",
"Name" : "\ u5546 \ u5bb6B,"
"Data" : [
57,
134,
137,
129,
145,
60,
49
],
"BarCategoryGap" : "20%",
"Label" : {
"The show" : true,
"The position", "top",
"Margin" : 8
}
}
],
"Legend" : [
{
"Data" : [
"\ u5546 \ u5bb6A,"
"\ u5546 \ u5bb6B
"],
"Selected" : {
"\ u5546 \ u5bb6A" : true,
"\ u5546 \ u5bb6B" : true
},
"The show" : true,
"Padding" : 5,
"ItemGap" : 10,
"ItemWidth" : 25,
"ItemHeight" : 14
}
],
"Tooltip" : {
"The show" : true,
"Trigger" : "item",
"TriggerOn" : "mousemove | click,"
"AxisPointer" : {
"Type" : "line"
},
"TextStyle" : {
14 "fontSize" :
},
"BorderWidth: 0
},
"XAxis" : [
{
"The show" : true,
"Scale" : false,
"NameLocation" : "the end",
"NameGap" : 15,
"GridIndex" : 0,
"Inverse" : false,
"Offset" : 0,
"SplitNumber" : 5,
"MinInterval" : 0,
"SplitLine" : {
"The show" : false,
"Graphics.linestyle" : {
"The show" : true,
"Width" : 1,
"Opacity" : 1,
"Curveness" : 0,
"Type" : "solid"
}
},
"Data" : [
"\ u886c \ u886b,"
"\ u6bdb \ u8863,"
"\ u9886 \ u5e26,"
"\ u88e4 \ u5b50,"
"\ u98ce \ u8863,"
"\ u9ad8 \ u8ddf \ u978b,"
"\ u889c \ u5b50
"]
}
],
"YAxis" : [
{
"The show" : true,
"Scale" : false,
"NameLocation" : "the end",
"NameGap" : 15,
"GridIndex" : 0,
"Inverse" : false,
"Offset" : 0,
"SplitNumber" : 5,
"MinInterval" : 0,
"SplitLine" : {
"The show" : false,
"Graphics.linestyle" : {
"The show" : true,
"Width" : 1,
"Opacity" : 1,
"Curveness" : 0,
"Type" : "solid"
}
}
}
],
"Title" :
{
"Text", "\ u67d0 \ u5546 \ u573a \ u9500 \ u552e \ u60c5 \ u51b5",
"Padding" : 5,
"ItemGap" : 10
}
]
};
Chart_bed301d616764f99a48cc355199d9d6c. SetOption (option_bed301d616764f99a48cc355199d9d6c);
</script>




Python code and js files on the local computer

The self. The current="file://d:\\render.html"
Self. Wv=webview. Webview. New (self)
Self. Wv. LoadURL (self. Current)



I use firefox and Internet explorer can normal open




Wxpython open figure





CodePudding user response:

He saw two coordinates, and the title

I wxpython open baidu website don't have these files,
Why open the local file to display

CodePudding user response:

Reason may be that the default WebBrowser control is to simulate IE7, so the CSS, js can display,

Try this article can solve,
https://www.cnblogs.com/tiny656/p/3855035.html

CodePudding user response:

The charts can show out, is unable to respond to mouse events,
With Internet explorer and firefox open can response,
  • Related