Skip to content

Commit b7f8b92

Browse files
committed
Always use charset "utf-8" on plotly script references
1 parent 527ee22 commit b7f8b92

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

src/Plotly.NET/ChartAPI/GenericChart.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ type HTML() =
5454

5555
let plotlyScriptRef =
5656
match plotlyReference with
57-
| CDN cdn -> script [ _src cdn ] []
57+
| CDN cdn -> script [ _src cdn; _charset "utf-8"] []
5858
| Full ->
5959
script
60-
[ _type "text/javascript" ]
60+
[ _type "text/javascript"; _charset "utf-8"]
6161
[
6262
rawText (InternalUtils.getFullPlotlyJS ())
6363
]

src/Plotly.NET/Globals.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ var renderPlotly_[SCRIPTID] = function() {
3434
};
3535
if ((typeof(requirejs) !== typeof(Function)) || (typeof(requirejs.config) !== typeof(Function))) {
3636
var script = document.createElement("script");
37+
script.setAttribute("charset", "utf-8");
3738
script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js");
3839
script.onload = function(){
3940
renderPlotly_[SCRIPTID]();

tests/ConsoleApps/FSharpConsole/Program.fs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,6 @@ open Newtonsoft.Json
1111

1212
[<EntryPoint>]
1313
let main argv =
14-
Chart.Point(
15-
[(0,10);(10,10)],
16-
UseDefaults = false
17-
)
18-
|> Chart.withShape(
19-
Shape.init(
20-
X0 = 0,
21-
X1 = 10,
22-
Y0 = 10,
23-
Y1 = 10,
24-
ShapeType = StyleParam.ShapeType.Line,
25-
Label = ShapeLabel.init(
26-
TextTemplate = "Here are the values i can access:<br><b>Raw variables (from shape definition):</b><br><br>x0: %{x0}<br>x1: %{x1}<br>y0: %{y0}<br>y1: %{y1}<br><br><b>Calculated variables:</b><br><br>xcenter (calculated as (x0+x1)/2): %{xcenter}<br>ycenter (calculated as (y0+y1)/2): %{ycenter}<br>dx (calculated as x1-x0): %{dx}<br>dy (calculated as y1-y0): %{dy}<br>width (calculated as abs(x1-x0)): %{width}<br>height (calculated as abs(y1-y0)): %{height}<br>length (calculated as sqrt(dx^2+dy^2)) -- for lines only: %{length}<br>slope (calculated as (y1-y0)/(x1-x0)): %{slope}<br>"
27-
)
28-
)
29-
)
30-
|> Chart.withSize(1000,1000)
14+
Chart.Point3D([1,2,3], UseDefaults=false)
3115
|> Chart.show
3216
0

0 commit comments

Comments
 (0)