Preventing connection to JS files on Steema webpage
Preventing connection to JS files on Steema webpage
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
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
Hello,
You can download those .js, place them to a folder next to your project and change those references for relative references. Ie:PeterF wrote:I need to include these scripts locally to my projects. I tried to find something on this topic, but without success yet.
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>
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Preventing connection to JS files on Steema webpage
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>
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
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.
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.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Preventing connection to JS files on Steema webpage
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
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
- Attachments
-
- JScript-HTML5 Live Charts.zip
- (3.41 KiB) Downloaded 914 times
Re: Preventing connection to JS files on Steema webpage
Hello Peter,
However I missed an easier way:
I assumed you were generating a .html file and I suggested you could edit it and modify the reference in there.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.
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 = "";
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Preventing connection to JS files on Steema webpage
You were right Yeray, its working now. Thank you.
Don't you know, when I replace tchart server control from example:
and use WebChart control from Toolbox with same values, I get an error about "Object reference not set to an instance of an object."
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>
Re: Preventing connection to JS files on Steema webpage
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
Hello,
I've tested it in IE 11.15.16299.0 and in Firefox 56.0.2.
I'm glad to hear that!PeterF wrote:You were right Yeray, its working now. Thank you.
I can't reproduce that error removing the full "style" line in JLineChart.aspx.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've tested it in IE 11.15.16299.0 and in Firefox 56.0.2.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |