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

Message ListMessage List     Post MessagePost Message

  Heat Lines?
Posted by jupistar on Jun-29-2019 09:56
This might be an odd request, but is there a way to create a line plot where the "intensity" of the line can be specified effectively generating "heat lines"?

Specifically, I'd like a line chart that has a white background, but individually multicolored lines based on extra values associated with each point of the line.

  Re: Heat Lines?
Posted by Peter Kwan on Jul-01-2019 18:53
Hi Jupistar,

There are several methods. If you have less than a few hundred line segments, you can just add each line segment in separate line layers. In this way, each line segment can have different colors.

For example, in C#:

// 4 data points for 3 line segments
double[] data = { 111, 222, 333, 444 };
int[] colors = { 0xff0000, 0x00cc00, 0x6666ff };

for (int i = 0; i < data.Length - 1; ++i)
{
    LineLayer layer = c.addLineLayer(new double[] { data[i], data[i + 1] }, color[i]);
    layer.setXData(new double[] { i, i + 1 });
}

If you have thousands of points or more, putting each line segment into its own layer can be too slow. In this case, we can draw the line segment directly using the Drawarea.line method. Please let me know if you need some sample code for this case.

Regards
Peter Kwan