Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am in the process of developing a Slope Chart using JQplot’s Bus Time Table Line Chart (see attached jqplot line chart.jpg).
In X-axis showing the Time & Y-axis showing the Stops.

This line-graph show a Bus going from the source (Stop-1) to the destination (Stop-2).

I’ve to customize the existing line chart to meet my requirements. Please find them below.
1. According to my requirement, each bus/vehicle has to start from the Depot to the first stop of service, and goes back to the Depot after finishing its service by denoting it by dotted lines. Please find the screenshot.
2. How do I specify the bus name that appears in the starting of the line.

3. The Buses (lines) are shown in different color lines, and the bus names are shown as legends with the respective colors. I would like to have a functionality that will just highlight or show only the respective bus lines if the bus is selected from the legend.
Any solutions to my queries are highly appreciated.
Posted

1 solution

You did try to structure your question very well. good. However, I don't see any of the screenshots nor a link to them. It is therefore very, very difficult to follow your text in making some sense.

However, I assume your talking about this JQPlot[^] ?

In that case I happen to know a tid or tad of JQPlot. I have never done what you're trying to achieve, but this is what you can do:
- You can highlight a serie or point via hovering, right? this is done by sending an "onhover" event to the plot.
- You need to catch the "onhover" of your grid and pump it through to the JQPlot. There are some events in JQPlot that you can fire through javascript (eg doubleclick) and handle accordingly. There are therefore three options I believe you can investigate:
1. Try to find out if you can control the "highlight" code, by sending an event (not likely, but it is the best solution)
2. Try to let the JQPlot think you're hovering over that specific series. (not ideal, but it should work)
3. Modify the JQPlot code to allow you to highlight the series. (Not recommended. Try to touch as little code as possible.)

I would start out with a pure HTML testpage that has one plot with 2 series and try to hardcode the highlight. (first by using the standard onhover feature and then trying to go around the onhover by using eg a button click)

It is not an easy feature you're trying to do here, I doubt you'll get a ready answer. Take some time to figure this out and do some tests.

best of luck.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900