Page 1 of 1
Preventing connection to JS files on Steema webpage
Posted: Mon Oct 30, 2017 11:45 am
by 16681948
Hello, guys I would like to ask you about specific problem, that I am dealing with.
I am programming statistics and charts on our intranet portal, where users have to authenticate yourself to make connection to the internet.
The problem is, when I ran one of your sample project for example (JLineChart.aspx from JScript-HTML 5 Live Charts folder) I had to fill my IDs twice.
I found in 'View source' option of current web page something like this:
<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="9CBF2F08" />
<script src="
http://www.steema.com/files/public/teec ... eechart.js" type="text/javascript"></SCRIPT>
<script src="
http://www.steema.com/files/public/teec ... -extras.js" type="text/javascript"></SCRIPT>
So teechart was trying to connect to internet to make a reference to these scripts.
But I can not require from our end users to fill their password and username twice, every time they want to display charts.
I need to include these scripts locally to my projects. I tried to find something on this topic, but without success yet.
Do you have any solution for these kind of scenarios?
Thank you
Re: Preventing connection to JS files on Steema webpage
Posted: Tue Oct 31, 2017 8:51 am
by yeray
Hello,
PeterF wrote:I need to include these scripts locally to my projects. I tried to find something on this topic, but without success yet.
You can download those .js, place them to a folder next to your project and change those references for relative references. Ie:
Code: Select all
<script src="../TeeChart_v2014.04.28.1.6/teechart.js" type="text/javascript"></SCRIPT>
<script src="../TeeChart_v2014.04.28.1.6/teechart-extras.js" type="text/javascript"></SCRIPT>
Re: Preventing connection to JS files on Steema webpage
Posted: Tue Oct 31, 2017 11:50 am
by 16681948
Hello Yeray,
I should mention it, that it was first thing I tried to locally include these scripts to my solution.
These lines are automatically generated by object on server side.
<script src="
http://www.steema.com/files/public/teec ... eechart.js" type="text/javascript"></SCRIPT>
<script src="
http://www.steema.com/files/public/teec ... -extras.js" type="text/javascript"></SCRIPT>
Re: Preventing connection to JS files on Steema webpage
Posted: Fri Nov 03, 2017 8:46 am
by yeray
Hello,
If you are generating those (.html) files exporting a Chart created with TeeChart .NET, you could edit that output using a Streams, and modify the references substituting that absolute&external path for your relative&internal path.
Re: Preventing connection to JS files on Steema webpage
Posted: Tue Nov 07, 2017 8:47 am
by 16681948
Yeray,
I am not sure if I understand, what you mean by "edit that output using a Streams, .....". Search pages about Streams in C#, but nothing about redirecting a references from external to internal paths.
There is no option for us to read from those references externally.
It would be perfect, if you could edit your example, that I uploaded, to make things work, without requiring an external connection.
Thank you.
Peter Fercak
Re: Preventing connection to JS files on Steema webpage
Posted: Tue Nov 07, 2017 9:24 am
by yeray
Hello Peter,
PeterF wrote:I am not sure if I understand, what you mean by "edit that output using a Streams, .....". Search pages about Streams in C#, but nothing about redirecting a references from external to internal paths.
There is no option for us to read from those references externally.
I assumed you were generating a .html file and I suggested you could edit it and modify the reference in there.
However I missed an easier way:
- Download teechart.js and teechart-extras.js:
- v2014 version you were using: teechart.js and teechart-extras.js.
- Latest: teechart.js and teechart-extras.js.
- Put those .js files somewhere in the folder structure of your web application. Ie, at "Interacting with Charts\JScript-HTML5 Live Charts" folder.
- Add a line of code to your charts to tell where the .js are relatively to the current .cs. Ie, at the end of your JLineChart.aspx.cs:
Code: Select all
ch1.Export.Image.JScript.SourceScriptPath = "";
Re: Preventing connection to JS files on Steema webpage
Posted: Wed Nov 08, 2017 8:49 am
by 16681948
You were right Yeray, its working now. Thank you.
Don't you know, when I replace tchart server control from example:
Code: Select all
<tchart:WebChart id="WebChart1"
runat="server" Config="..."
TempChart="Session" AutoPostback="False"
GetChartFile="GetChart.aspx" PictureFormat="JScript"
Height="300px" Width="900px"></tchart:WebChart>
and use WebChart control from Toolbox with same values, I get an error about "Object reference not set to an instance of an object."
Re: Preventing connection to JS files on Steema webpage
Posted: Wed Nov 08, 2017 12:51 pm
by 16681948
I find out, that I need to leave "style" option for tchart. If I delete for example position or z-index I will get an error.
Code: Select all
style="Z-INDEX: 107; LEFT: 400px; POSITION: relative; TOP: 15px;"
Re: Preventing connection to JS files on Steema webpage
Posted: Thu Nov 09, 2017 11:53 am
by yeray
Hello,
PeterF wrote:You were right Yeray, its working now. Thank you.
I'm glad to hear that!
PeterF wrote:I find out, that I need to leave "style" option for tchart. If I delete for example position or z-index I will get an error.
I can't reproduce that error removing the full "style" line in JLineChart.aspx.
I've tested it in IE 11.15.16299.0 and in Firefox 56.0.2.