ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  chartdirector c++ / web / html / how to
Posted by aldric on Dec-14-2022 21:23
Hi there,
first of all, I would like to point the fact we bought chartdir for c++ using it under Qt.
And a huge part of our project, is now done using this library without posting or help.
It works very well.
So thank you.

Now, I saw on the home page that chartdir also work with html.

Here's my question, I didn't find any example in c++ to use chartdir in a windows server and be able to draw chart on an html page.

In fact I would like to use my work (a vertical multichart) refreshed each 5 sec on a webpage.

Any Idea?
Any advice ?
Any example or link ?

Thank you in advance.
Sorry for my bad english
Have a nice day

  Re: chartdirector c++ / web / html / how to
Posted by Peter Kwan on Dec-15-2022 02:59
Hi Aldric,

A lot of our clients are using ChartDirector can for web pages.

To develop a desktop GUI application, you need to GUI framework such as Qt. Similarly, to develop a web application, you need a web framework such as ASP.NET (C#/VB), PHP, Java/JSP, ... Would you mind clarify which web framework you plan to use?

As far as I know, there is no web framework for C or C++. If you are using IIS as the web server, ASP.NET is a possible choice. If you are using Linux/Apache, you may try PHP.

ChartDirector for .NET supports ASP.NET, ChartDirector for PHP supports PHP, and ChartDirector for Java supports Java/JSP. There are many web examples included in these programming language editions of ChartDirector, including some real-time chart examples.

Best Regards
Peter Kwan

  Re: chartdirector c++ / web / html / how to
Posted by aldric on Dec-16-2022 18:21
Thank you for the quick reply and explanation.
For now, we only developped C++/Qt app. The web "stuff" is a new demand.
So we are in research mode. Using asp.net or c#

Solution #1: create a server in c++/qt that can plot the chart in a html5 canvas, but we also need to send back the browser mouse events ... not reasonable

So, all in all, if we need to use another language for the web, or choice will be js , in fact React.js+TypeScript

A link for examples or tutorial in js could be very nice and kind, if you think about a good starting point. As here, we are all native c/c++ developpers and can't afford to employ another person.

The last question is a license question, as we bought a license for C++, should we buy anotherone for js / react.js ? Or is it included in the license anyway?

By the way, as a coder, I should say I enjoyed working with your lib. At first I found the process of deleting / creating instance quite strange, but all in all, performance wise it does have a very minor impact compared to the drawing stuff.

So performance are ok for our need.
Reliability is very good.
And, because our needs are sometimes quite ... non standards, the flexibility of your lib is top level.

I was used to TeeChart on delphi. Theusage is quite different, but your lib can compete with TeeChart on what it can do. That's not always the case.

Glad to say I'm happy with it.
Have a nice day.

  Re: chartdirector c++ / web / html / how to
Posted by aldric on Dec-16-2022 18:25
aldric wrote:
Using asp.net or c#

I meaned : NOT using asp.net or c#, we will, I meaned. May the force be with you.

  Re: chartdirector c++ / web / html / how to
Posted by Peter Kwan on Dec-17-2022 03:39
Hi Aldric,

I assume your HTML chart is designed to be used over an HTTP connection (as opposed to directly opening a local file on the hard disk).

You probably need to think how you system will handle the follows:

(a) The HTTP protocol, which may include SSL, authentication, cookies and session management (if multiple browser windows connect at the same time, it needs a way to distinguish the windows), etc.. These are normally handled by a web server. The browser talks communicates the web server, and the web server communicates with your code.

(b) How the web server communicates with your code.

All web servers support a method called CGI. The server will execute a command line program and pass the http request as parameters. The output of that command will be sent back to the browser as http response. This method works for C++, as you can write a command line program in C++. However, executing a command line program for every request is very inefficient, so it is rarely used in practice.

The current practice is to have a programming system that is integrated with the web server, so that the request and response and be handled efficiently. The PHP, JSP/Java, ASP.NET are such programming systems.

Some applications will include its own web server, such as to link the code with an open source web server.



To display a chart on the browser side, the browser can obtain a chart image from the server, or it can obtain the data and draw the chart itself using Javascript. ChartDirector uses the former approach.

Regardless of which method is used, there will be some Javascript code on the browser side to handle local user interactions. For example, for ChartDirector, there can be a track cursor that moves with the mouse. They are handled locally on the browser with ChartDirector's Javacript library. So it is not necessary to send every mouse events to the server.

The React.js+TypeScript are Javascript library to make it easier to write Javascript.

To get a feeling on how it works, you can download ChartDirector for .NET, open the Visual Studio solution ChartDirectorNetWebChartsNetWebCharts.sln, and press the "Run" button to compile and run the code. It should display a menu page with a lot of examples, including real-time chart examples. You can try to see how it works.

For licensing, if you have a Windows/Linux ChartDirector license, you can use ChartDirector on Windows/Linux for both desktop and web applications. The browser side code does not require license. (ChartDirector runs on the server side.)

Best Regards
Peter Kwan

  Re: chartdirector c++ / web / html / how to
Posted by aldric on Dec-19-2022 21:57
yeah, right I'm already quite aware of the structure you talked about.
No need to explain.

The misunderstanding came from my lack of precision.

For the web-charting, I'm looking for a client side library.
For our project, I see no good reason to make the server work for the gui part more than necessary.

It already needs to handle a huge number of differential equations and other time consumming algorythms.

We will still use your lib in c++ for the desktop app for quite a time.

I already found an open source client side charting library with react wrappers. It's in test for now.

Later, we will certainly unify all that, so, if one day, you plan to make a client side chartdir lib for the web, I think (I may be wrong) it could be a good idea. At least chance are we buy it because we are satisfied with your work even if I feel it's not well fited yet for our long term dev due to this change of startegy.

  Re: chartdirector c++ / web / html / how to
Posted by aldric on Dec-19-2022 22:04
re-reading your former response, it seems there's finally a client side chart library in js with chart dir.

I will test it soon