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

Message ListMessage List     Post MessagePost Message

  makechart takes too long time to write a picture file
Posted by Tom Andson on Jul-20-2023 14:35
Attachments:
I have a 1024x1024 data to be shown on the screen. According to the given example, the first step is to generate the picure. And then load it and show it on screen. However, it takes 30 seconds time to the write the picture file, for example, "cDlg->makeChart("surface3.jpg");"    Is there any fast way?
drawsurface.txt
void DrawSurface(SurfaceChart *cDlg,double *dataX, double *dataY, double *dataZ, const int dataX_size, const int dataY_size,const int dataZ_size)
{
    // Create a SurfaceChart object of size 720 x 540 pixels
	double fSizesScaleFactor = CalPhaseDlg.fEffectiveAreaSize/2.0;
    // Add a title to the chart using 20 points Times New Roman Italic font
	if(1){
		CString f;
		f.Format(_T("PV=%8.3f; RMS=%8.3f"),CalPhaseDlg.PV,CalPhaseDlg.RMS);
		USES_CONVERSION;
		std::string s(W2A(f));
		const char* cstr = s.c_str(); 
		cDlg->addTitle(cstr, "Times New Roman Italic", 20);
	}
    // Set the center of the plot region at (360, 245), and set width x depth x height to 360 x 360
    // x 270 pixels
    cDlg->setPlotRegion(360, 245, 360, 360, 270);

    // Set the elevation and rotation angles to 20 and 30 degrees
    //cDlg->setViewAngle(30, 210);
    cDlg->setViewAngle(30, 45);

	DoubleArray zData = DoubleArray(dataZ,dataZ_size);
    for(int i = 0; i < zData.len; ++i) {
		if (CalPhaseDlg.fMask[i]==0) {
            ((double*)(zData.data))[i] = Chart::NoValue;
        }
		else{
            ((double*)(zData.data))[i] = dataZ[i];
		}
    }
	
    // Set the data to use to plot the chart
    //cDlg->setData(DoubleArray(dataX, dataX_size), DoubleArray(dataY, dataY_size), DoubleArray(dataZ,dataZ_size));
    cDlg->setData(DoubleArray(dataX, dataX_size), DoubleArray(dataY, dataY_size), zData);

    // Spline interpolate data to a 80 x 80 grid for a smooth surface
    cDlg->setInterpolation(1080, 1080);

    // Set surface grid lines to semi-transparent black (dd000000)
    cDlg->setSurfaceAxisGrid(0xdd000000);
	cDlg->setWallThickness(2);
    // Set contour lines to semi-transparent white (80ffffff)
    cDlg->setContourColor(0x80ffffff);

    // Add XY projection
    cDlg->addXYProjection();

	
    // Show only the xy wall, and hide the yz and zx walls.
    cDlg->setWallVisibility(true, false, false);

    // Add a color axis (the legend) in which the left center is anchored at (645, 270). Set the
    // length to 200 pixels and the labels on the right side. Use smooth gradient coloring.
    cDlg->setColorAxis(645, 270, Chart::Left, 200, Chart::Right)->setColorGradient();

    // Set the x, y and z axis titles using 10 points Arial Bold font
    cDlg->xAxis()->setLabelStyle("Arial Bold", 12);
    cDlg->xAxis()->setColors(Chart::Transparent, Chart::TextColor);
    //cDlg->xAxis()->setLabelOffset(0.5);
	CString sStr,sStr1;
	sStr.Format(_T("X(%6.2f mm)"),fSizesScaleFactor);
	USES_CONVERSION;
	std::string s(W2A(sStr));
	const char* cstr = s.c_str();
	cDlg->xAxis()->setTitle(cstr, "Arial Bold Italic", 12);

	// Set the y-axis scale. Use 8pt Arial Bold font. Set axis color to transparent, so only the
    // labels visible. Set 0.5 offset to position the labels in between the grid lines.
    cDlg->yAxis()->setLabelStyle("Arial Bold", 12);
    cDlg->yAxis()->setColors(Chart::Transparent, Chart::TextColor);
    //cDlg->yAxis()->setLabelOffset(0.5);
	sStr1.Format(_T("Y(%6.2f mm)"),fSizesScaleFactor);
	std::string ss(W2A(sStr1));
	const char* cStr = ss.c_str();
	cDlg->yAxis()->setTitle(cStr, "Arial Bold Italic", 12);
	
	cDlg->xAxis()->setLinearScale(-1, 1, 0.2);
    cDlg->yAxis()->setLinearScale(-1, 1, 0.2);

    cDlg->zAxis()->setTitle("Wavefront", "Arial Bold", 10);

    // Output the chart
    cDlg->makeChart("surface3.jpg");
}

  Re: makechart takes too long time to write a picture file
Posted by Tom Andson on Jul-20-2023 15:01
Additionally, it is possible to show the picture on MFC's picture control of a VC program' main dialog without save the piture on disc.  Thanks a lot

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-20-2023 21:13
Hi Tom,

I suspect it may be due to the interpolation to 1080 x 1080 is too high.

Like all 3D graphics, the 3D surface is drawn as triangles. A 1080 x 1080 grid will have over a million rectangles, or 2 million triangles. It may take time to compute the triangles using spline surface fitting, and then draw the 2 million triangles into pixels with 3D lighting effects.

May be you can try 100 x 100. This can test if the above is the cause of the problem. Normally, it is not necessary to interpolate higher than the number of surface pixels (360 x  360 in your code).

If you use higher interpolation, you may consider to use linear interpolation instead of spline interpolation, since for dense data points, the spline curve approaches the linear shape. You may also consider use rectangular shading mode, as triangles containing only one or a few pixels can be approximated as a rectangle.

c->setInterpolation(100, 100, false);
c->setShadingMode(Chart::RectangularShading);

See:

https://www.advsofteng.com/doc/cdcpp.htm#surfaceshading.htm
https://www.advsofteng.com/doc/cdcpp.htm#SurfaceChart.setShadingMode.htm
https://www.advsofteng.com/doc/cdcpp.htm#SurfaceChart.setInterpolation.htm

For your data points (1024 x 1024 = over 1 million points), I assume they lie on a rectangular grid (as opposed to scattered points). In other words, dataX_size = 1024, dataY_size = 1024 and dataZ.len = 1024 * 1024. For large number of points, interpolation for scattered points can be slower than gridded points.

Best Regards
Peter Kwan

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-20-2023 21:31
Hi Tom,

For showing the picture on MFC's picture control show the picture on MFC's picture control of a VC program' main dialog without save the picture on disc, it is exactly what we do in our sample code.

Note that there are MFC sample code that comes with ChartDirector (in ChartDirector/mfcdemo). All of them show the chart on a "MFC's Picture Control" without saving the picture on disc. For testing, you may try the "helloworld" MFC sample code. You can find the Picture Control in the Dialog in the Resource Editor.

See also the section on "The CChartViewer MFC Control" in the following:

https://www.advsofteng.com/doc/cdcpp.htm#firstmfcproject.htm

As far as I know, there is no "Picture Control" in MFC. There is a "Picture Control" in the Resource Editor. By default, the Resource Editor assigns the Picture Control to the MFC CStatic class. The CChartViewer is a subclass of CStatic. The CChartViewer implements the code that converts the chart to a HBITMAP, which is supported by CStatic. The CChartViewer is released as source code CChartViewer.cpp, so you can examine it to see how the conversion is implemented.

Best Regards
Peter Kwan

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-21-2023 07:50
Attachments:
Hi,Peter, Thank you very much for your kindly help. I changed my code according to your suggestions. However, it still takes a long time of more than 20 second to show the image. And It mainly because of the last command " cDlg->makeChart("surface3.jpg");"
It seems that the time is not shortened obviously.
picture.jpg

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-21-2023 08:29
In addition, the data to show on the screen is a matrix with about 1k x 1k grid point as shown in the above figure. The data in four corner of the matrix is defined as NaN.  I used it in VC2010 to paint the data with ChartDirector . Thanks a lot.

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-21-2023 17:44
Thanks for the picture. It should help a lot. With it I can try to reproduce the problem and find ways to speed it up.

The makeChart call is to render the surface chart into pixels. All earlier ChartDirector methods are just used to configure the chart parameters. So the majority of the CPU will be in makeChart. After creating the pixels, the makeChart will then encode them in the JPG format. The last step should be quite fast. So the delay is due to the rendering. Even if we do not use JPG, it still needs to create the pixels in order to display on screen, and it will consume similar time.

Regards
Peter Kwan

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-22-2023 01:57
Attachments:
Hi Tom,

I found out the reason for taking so long to produce the chart. It is because there are a lot of data points (over 1 million points), and some data points are missing (Chart::NoValue points), so ChartDirector treated them as scattered data instead of gridded data. As mentioned in my last message, large number of scattered data points can be slow.

If I do not add the Chart::NoValue points, the chart can be drawn in less than 1 second.

To solve the problem, of course you can use less data points. After some testing, I also found another method that works even with 1024 x 1024 points. Instead of using Chart::NoValue for the zData, i use the 4th array 4th array (the wData) to specify that certain region should use the transparent color. This is by setting certain points in the wData to a number below of the color axis range, and set the "underflow color" to Chart::Transparent.


The following is my test code. It is modified from the "Surface Chart" in the mfcdemo sample code. To try the code below, please open the sample code at "ChartDirector/mfcdemo/mfcdemo.sln" and set "mfcdemo" as the active project. In the project, you can find a file "mfccharts.cpp" which contains the sample charts. Inside, there is a "void surface(CChartViewer *viewer, int /* chartIndex */)" function. Please replace that function with the code below. Then run the code, and the "Surface Chart" will become like that in the attached image.


void surface(CChartViewer *viewer, int /* chartIndex */)
{
    double dataX[1024];
    const int dataX_size = sizeof(dataX) / sizeof(*dataX);
    double dataY[1024];
    const int dataY_size = sizeof(dataY) / sizeof(*dataY);
    std::vector<double> dataZ(dataX_size * dataY_size);
    DoubleArray zData(dataZ.data(), dataZ.size());
    std::vector<double> dataW(dataZ.size());
    DoubleArray wData(dataW.data(), dataW.size());

    for (int y = 0; y < dataY_size; ++y)
        dataY[y] = 1 - y * 2.0 / dataY_size;
    for (int x = 0; x < dataX_size; ++x)
        dataX[x] = 1 - x * 2.0 / dataX_size;

    for (int y = 0; y < dataY_size; ++y) {
        double yy = dataY[y];
        int ptr = y * dataX_size;
        for (int x = 0; x < dataX_size; ++x) {
            double xx = dataX[x];
            dataZ[ptr] = 1 - xx + yy;
            dataW[ptr] = (xx * xx + yy * yy < 1) ? dataZ[ptr] : -999;
            ++ptr;
        }
    }

    // Create a SurfaceChart object of size 720 x 600 pixels
    SurfaceChart* c = new SurfaceChart(720, 600);

    // Set the center of the plot region at (330, 290), and set width x depth x height to
    // 360 x 360 x 270 pixels
    c->setPlotRegion(330, 290, 360, 360, 270);

    // Set the data to use to plot the chart
    c->setData(DoubleArray(dataX, dataX_size), DoubleArray(dataY, dataY_size), zData, wData);

    // Spline interpolate data to a 80 x 80 grid for a smooth surface
    c->setInterpolation(100, 100, false);

    // Set the view angles
    c->setViewAngle(30, 45);

    // Set surface grid lines to semi-transparent black (dd000000)
    c->setSurfaceAxisGrid(0xdd000000);
    c->setWallThickness(2);
    // Set contour lines to semi-transparent white (80ffffff)
    c->setContourColor(0x80ffffff);

    // Add XY projection
    c->addXYProjection();

    // Show only the xy wall, and hide the yz and zx walls.
    c->setWallVisibility(true, false, false);

    // Add a color axis (the legend) in which the left center is anchored at (645, 270). Set the
    // length to 200 pixels and the labels on the right side. Use smooth gradient coloring.
    c->setColorAxis(645, 270, Chart::Left, 200, Chart::Right)->setColorGradient(true, IntArray(), Chart::Transparent, Chart::Transparent);

    c->xAxis()->setLinearScale(-1, 1, 0.2);
    c->yAxis()->setLinearScale(-1, 1, 0.2);
    c->colorAxis()->setLinearScale(-1, ArrayMath(wData).maxValue());
    c->zAxis()->setLinearScale(-1, ArrayMath(zData).maxValue());

    viewer->setChart(c);
}


Regards
Peter Kwan
mfcdemo_20230722014249.png

  Re: makechart takes too long time to write a picture file
Posted by Tom on Jul-22-2023 08:03
Hi, Peter, Thank you very much for your kindly help. Your answer is very valuable, and I will try it. Thanks a lot.

  Re: makechart takes too long time to write a picture file
Posted by Tom on Jul-22-2023 11:55
Hi, Peter, Thank you very much for your kindly help. It takes about 0.6s to paint the picture with about 1kx1k grid point now, which  is very wonderful. And I does not feel time delay. Your suggestions is very valuable. Thanks a lot.

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-26-2023 10:09
Attachments:
Hi,Peter

Thank you very much for your kindly help. I am now facing the same problem when I use "XY chart" as said in "https://www.advsofteng.com/doc/cdcpp.htm#contourinterpolate.htm".

I do not want to show the data in four corners, and data only in the circle area could be shown. How to realized it?  It seems that the method you told before does not work now.

best regards
fig.jpg

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-26-2023 10:12
Additionally, if I set the data in the corners as "Chart::NoValue", the figure is very good, but the time is too long again.

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-26-2023 13:30
Hi,

Similar method should work in the ContourLayer. Have you set the "underflow color" to Chart::Transparent? The code should be like:


// Use -999 for the missing points
for (int y = 0; y < dataY_size; ++y) {
    double yy = dataY[y];
    int ptr = y * dataX_size;
    for (int x = 0; x < dataX_size; ++x)
        zData[ptr++] = (xx * xx + yy * yy < 1) ? 1 - xx + yy : -999;
}

.....


ColorAxis* cAxis = layer->setColorAxis(505, 40, Chart::TopLeft, 400, Chart::Right);

// Set underflow color to transparent
cAxis->setColorGradient(true, IntArray(), Chart::Transparent, Chart::Transparent);

// Determine the actual minimum value (without the artificial -999)
double minValue = 1E10;
for (int i = 0; i < zData.size(); ++i)
    if ((zData[i] != -999) && (zData[i] < minValue)) minValue = zData[i];

c->setLinearScale(minValue, ArrayMath(zData).maxValue());


Best Regards
Peter Kwan

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-26-2023 16:15
Hi,Peter

Thank you very much for your kindly help. The following is the function's code:



int DrawHeatMapContANA(XYChart *cDlg, double *dataX, double *dataY, double *dataZ, const int dataX_size, const int dataY_size,const int dataZ_size,int iW,int iH)
{
    // The diameter of the wafer
    int diameter = dataX_size;
    double radius = diameter / 2.0;
double fSizesScaleFactor = CalPhaseDlg.fEffectiveAreaSize/2.0;
    // The random data array are for a square grid of 20 x 20 cells
    RanSeries* r = new RanSeries(2);
DoubleArray zData = r->get2DSeries(diameter, diameter, CalPhaseDlg.fWFmin,CalPhaseDlg.fWFmax);

    //We remove cells that are outside the wafer circle by setting them to NoValue
    for(int i = 0; i < zData.len; ++i) {
//if (CalPhaseDlg.fMask[i]) {
if (CCDdlg.iMaskROI[i]) {
((double*)(zData.data))[i] = dataZ[i];
}
else{
((double*)(zData.data))[i] = -999;//Chart::NoValue;
}
}

    // Set the plotarea at (50, 40) and of size 400 x 400 pixels. Set the backgound and border to
    // transparent. Set both horizontal and vertical grid lines to light grey. (0xdddddd)
    //PlotArea* p = cDlg->setPlotArea(150, 50, iW*1.25, iW*1.25, -1, -1, 0xc0000000, -1);
    PlotArea* p = cDlg->setPlotArea(80, 50, iW*0.7, iW*0.7,RGB(240,240,240),RGB(240,240,240));

    // Create a discrete heat map with 20 x 20 cells
    ContourLayer* layer = cDlg->addContourLayer(DoubleArray(dataX, dataX_size), DoubleArray(dataY,dataY_size),  zData);
layer->setZBounds(CalPhaseDlg.fMinWF,CalPhaseDlg.fMaxWF);

//layer->colorAxis()->setColorGradient(true);
layer->colorAxis()->setLinearScale(CalPhaseDlg.fMinWF,CalPhaseDlg.fMaxWF);
layer->setSmoothInterpolation(false);
layer->setContourColor(Chart::Transparent,RGB(0,0,0));
//layer->setContourColor(0x80ffffff);

    cDlg->xAxis()->setLinearScale(-1, 1, 0.5);
    cDlg->xAxis()->setLabelStyle("Arial Bold", 12);
//   cDlg->xAxis()->setColors(Chart::Transparent, Chart::TextColor);
//   cDlg->xAxis()->setLabelOffset(0.5);
    // When x-axis and y-axis color to transparent
    cDlg->xAxis()->setColors(Chart::Transparent);
CString sStr,sStr1;
sStr.Format(_T("X(%6.2f mm)"),fSizesScaleFactor);
USES_CONVERSION;
std::string s(W2A(sStr));
const char* cstr = s.c_str();
    cDlg->xAxis()->setTitle(cstr, "Arial Bold Italic", 12);

    cDlg->yAxis()->setLinearScale(-1,1, 0.5);
    cDlg->yAxis()->setLabelStyle("Arial Bold", 12);
//   cDlg->yAxis()->setColors(Chart::Transparent, Chart::TextColor);
//   cDlg->yAxis()->setLabelOffset(0.5);
    cDlg->yAxis()->setColors(Chart::Transparent);
sStr1.Format(_T("Y(%6.2f mm)"),fSizesScaleFactor);
std::string ss(W2A(sStr1));
const char* cStr = ss.c_str();
    cDlg->yAxis()->setTitle(cstr, "Arial Bold Italic", 12);

    cDlg->adjustBrightness(1,0.2);


   // Position the color axis 20 pixels to the right of the plot area and of the same height as the
    // plot area. Put the labels on the right side of the color axis. Use 8pt Arial Bold font for
    // the labels.
    ColorAxis* cAxis = layer->setColorAxis(p->getRightX() + 20, p->getTopY()-20, Chart::TopLeft, p->getHeight(), Chart::Right);
// Set underflow color to transparent
cAxis->setColorGradient(true, IntArray(), Chart::Transparent, Chart::Transparent);
// Determine the actual minimum value (without the artificial -999)
//cDlg->setLinearScale(CalPhaseDlg.fWFmin,CalPhaseDlg.fWFmax);  //error: setLinearScale is not a function of cDlg
layer->colorAxis()->setLinearScale(CalPhaseDlg.fWFmin,CalPhaseDlg.fWFmax);

    // Set color axis labels to use Arial Bold font
    cAxis->setLabelStyle("Arial Bold",12);

    // Use smooth gradient coloring
    //cAxis->setColorGradient(true);
cDlg->setBackground(RGB(240,240,240));
layer->setSmoothInterpolation(false);
//layer->setContourColor(Chart::Transparent);

//layer->colorAxis()->setLinearScale(CalPhaseDlg.fWFmin,CalPhaseDlg.fWFmax);//,CalPhaseDlg.PV/10.0);

    cDlg->makeChart("wafermapana.png");
    delete r;
    return 0;
}


Best regards

Tom

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-26-2023 17:12
Additionally, it seems that if I want to display a Greek alphabet  â€œLambda” as the unit on the axis X. It cannot be normally displayed.

best regards

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-26-2023 17:39
Hi Tom,

For the DrawHeatMapContANA, the issue is at the setZBounds line. With the setZBounds line, if the data value outside the bounds, ChartDirector will adjust it to inside the bound. So the value of -999 is adjusted to CalPhaseDlg_fMinWF and the color becomes blue. You can remove this line to solve the problem.

//This line is not necessary
//layer->setZBounds(CalPhaseDlg_fMinWF, CalPhaseDlg_fMaxWF);

Best Regards
Peter Kwan

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-26-2023 18:13
Hi Tom,

ChartDirector can display all characters in unicode, including the lambda character.

I assume your lambda character comes from your source code, that is, the compiler can see the lambda character. (If the lambda character is read from a database or external file or from user input, then the compiler cannot see it as it is entered at runtime.)

If you see "?" instead of the lambda character, it is probable that the compiler compiles the text string into machine code using a text encoding that does not support the lambda character. In this case, VC++ will change the character to "?".

If the above is the cause of the problem, please configure your compiler to compile the text string using the utf-8 encoding. There are 3 methods:

(a) Set the execution character set to UTF-8.

#pragma execution_character_set("utf-8")

See:

https://learn.microsoft.com/en-us/cpp/preprocessor/execution-character-set?view=msvc-170

(b) Use u8 text string.

const char* myLabel = u8"abc def";

(c) Use wide string (2-byte unicode) or _T string, and convert it to utf8 with WCHARtoUTF8 or TCHARtoUTF8.

c->xAxis()->setTitle(WCHARtoUTF8(L"abc def"), "Arial Bold Italic", 12);

or

c->xAxis()->setTitle(TCHARtoUTF8(_T"abc def"), "Arial Bold Italic", 12);


Best Regards
Peter Kwan

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-26-2023 18:57
Hi, Peter

Thank you very much for your kindly help. I know where and why the problems are originated. You are so great!!!

best regards

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-28-2023 08:14
Attachments:
Hi,Peter,

Thank you very much for your kindly help. How to remove the bulge at the edge of the circle as shown in the attahed picture? When I use NoValue, there is not data bulge at the edge.

best regards
DatainEdge.jpg

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-28-2023 16:23
Attachments:
Hi,Peter

Thank you very much for your kindly help. Can we define the color as the as the attached figure? How to change the colorbar?

Best regards
zg.JPG

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-28-2023 17:01
Hi Tom,

For the "color bar", the following is an example in ChartDirector that demonstrates using different color schemes:

https://www.advsofteng.com/doc/cdcpp.htm#contourcolor.htm

Basically, you can use ColorAxis.setColorGradient or ColorAxis.setColorScale to configure the color scheme:

https://www.advsofteng.com/doc/cdcpp.htm#ColorAxis.setColorGradient.htm
https://www.advsofteng.com/doc/cdcpp.htm#ColorAxis.setColorScale.htm

Best Regards
Peter Kwan

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-28-2023 16:56
Hi Tom,

For the "bulge at the edge", is the chart produced with simulated random data, or is it from your real data? If it is using random data, is it possible to provide me with the code that generates the chart so I can reproduce it myself?

Best Regards
Peter Kwan

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-28-2023 18:59
Attachments:
Hi,Peter

Thank you very much for your kindly help. It seems that it is not because of the data. And because the file size must be less than 250k. I divide the TXT file into four files. They are a square matrix as shown in the figure.

best regards
unwrappedPhase1.rar
unwrappedPhase1.rar

122.51 Kb

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-28-2023 18:59
Attachments:
the second file
unwrappedPhase2.rar
unwrappedPhase2.rar

212.04 Kb

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-28-2023 19:00
Attachments:

the third file
unwrappedPhase3.rar
unwrappedPhase3.rar

211.98 Kb

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-28-2023 19:00
Attachments:

the fourth file
unwrappedPhase4.rar
unwrappedPhase4.rar

123.69 Kb

  Re: makechart takes too long time to write a picture file
Posted by Peter Kwan on Jul-29-2023 02:32
Attachments:
Hi Tom,

Thanks for taking the time to prepare the data file. I have just tried it. I noted that it contains 436 x 436 points, and it only contains the wData. I set the zData the same as the wData and in my testing, the chart is quite normal if I use linear interpolation (as opposed to smooth interpolation).

c->setInterpolation(100, 100, false);

For points with such high density, it is better to use linear rather than smooth interpolation.

One potential issue I can think of it issues in the zData. In your code, you have a "mask". When a certain point is masked, the code sets the wData to -999, but how about the zData? Is the zData valid or reasonable for a masked point? If the zData point is not set because it is masked, in C++, it will contain random values, which can be from negative infinity to positive infinity.

You may think the random point is transparent and therefore invisible, but the surface is actually consists of triangles, and each triangles has 3 points. If one point is transparent, but the other two points are not transparent, the triangle will be partially visible. If the transparent point contains random values, it will affect the entire triangle, and may cause the issue you see. To solve the problem, invisible zData must still be set to some reasonable values.

With your data, I have tried to set the invisible zData to 0, and it works fine. Setting it to -999 for the zData also works, but it causes a border around the circle. (The attached image is created using -999 for the invisible zData.)

Best Regards
Peter Kwan
testchart.png

  Re: makechart takes too long time to write a picture file
Posted by 23 seconds to draw a picture on Jul-29-2023 15:10
Hi, Peter,

Thank you very much for your kindly help. The painting problem is overcome now and is mainly because I am not familiar with the ChartDirector. Thanks a lot.
The colorbar is difficult to do by myself. And I wish the future version of ChartDirector could provide that kind of colorbar.

best regards

  Re: about the colorbar
Posted by Tom on Aug-02-2023 11:37
Attachments:
Hi,Peter

Thank you very much for your kindly help. I want to use the color data in the attached txt file to draw picture. The color data is shown in the picture. When I use the data in drawing picture, it shows a whole black picture. There problems in the following setting:

double colorGradient[256*2];
for(int i=0;i<256;i++){
colorGradient[2*i] = CalPhaseDlg.fWFmin+i*CalPhaseDlg.PV/256.0;
colorGradient[2*i+1] = RGB(DrawmapColorbar(i,1)/255.0*CalPhaseDlg.PV,DrawmapColorbar(i,2)/255.0*CalPhaseDlg.PV,DrawmapColorbar(i,3)/255.0*CalPhaseDlg.PV);
}
const int colorScale_size = (int)(sizeof(colorGradient)/sizeof(*colorGradient));
cDlg->setColorAxis(645, 270, Chart::Left, 500, Chart::Right)->setColorScale(DoubleArray(colorGradient,colorScale_size));

Thanks a  lot.

best regards
color.txt
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   1.0100000e+02
   2.5500000e+02   0.0000000e+00   9.6000000e+01
   2.5500000e+02   0.0000000e+00   9.1000000e+01
   2.5500000e+02   0.0000000e+00   8.7000000e+01
   2.5500000e+02   0.0000000e+00   8.2000000e+01
   2.5500000e+02   0.0000000e+00   7.7000000e+01
   2.5500000e+02   0.0000000e+00   7.2000000e+01
   2.5500000e+02   0.0000000e+00   6.7000000e+01
   2.5500000e+02   0.0000000e+00   6.3000000e+01
   2.5500000e+02   0.0000000e+00   5.8000000e+01
   2.5500000e+02   0.0000000e+00   5.3000000e+01
   2.5500000e+02   0.0000000e+00   4.8000000e+01
   2.5500000e+02   0.0000000e+00   4.3000000e+01
   2.5500000e+02   0.0000000e+00   3.8000000e+01
   2.5500000e+02   0.0000000e+00   3.4000000e+01
   2.5500000e+02   0.0000000e+00   2.9000000e+01
   2.5500000e+02   0.0000000e+00   2.4000000e+01
   2.5500000e+02   0.0000000e+00   1.9000000e+01
   2.5500000e+02   0.0000000e+00   1.4000000e+01
   2.5500000e+02   0.0000000e+00   1.0000000e+01
   2.5500000e+02   4.0000000e+00   5.0000000e+00
   2.5500000e+02   7.0000000e+00   0.0000000e+00
   2.5500000e+02   1.1000000e+01   0.0000000e+00
   2.5500000e+02   1.5000000e+01   0.0000000e+00
   2.5500000e+02   1.8000000e+01   0.0000000e+00
   2.5500000e+02   2.2000000e+01   0.0000000e+00
   2.5500000e+02   2.6000000e+01   0.0000000e+00
   2.5500000e+02   2.9000000e+01   0.0000000e+00
   2.5500000e+02   3.3000000e+01   0.0000000e+00
   2.5500000e+02   3.6000000e+01   0.0000000e+00
   2.5500000e+02   4.0000000e+01   0.0000000e+00
   2.5500000e+02   4.4000000e+01   0.0000000e+00
   2.5500000e+02   4.7000000e+01   0.0000000e+00
   2.5500000e+02   5.1000000e+01   0.0000000e+00
   2.5500000e+02   5.5000000e+01   0.0000000e+00
   2.5500000e+02   5.8000000e+01   0.0000000e+00
   2.5500000e+02   6.2000000e+01   0.0000000e+00
   2.5500000e+02   6.6000000e+01   0.0000000e+00
   2.5500000e+02   6.9000000e+01   0.0000000e+00
   2.5500000e+02   7.3000000e+01   0.0000000e+00
   2.5500000e+02   7.7000000e+01   0.0000000e+00
   2.5500000e+02   8.0000000e+01   0.0000000e+00
   2.5500000e+02   8.4000000e+01   0.0000000e+00
   2.5500000e+02   8.7000000e+01   0.0000000e+00
   2.5500000e+02   9.1000000e+01   0.0000000e+00
   2.5500000e+02   9.5000000e+01   0.0000000e+00
   2.5500000e+02   9.8000000e+01   0.0000000e+00
   2.5500000e+02   1.0200000e+02   0.0000000e+00
   2.5500000e+02   1.0600000e+02   0.0000000e+00
   2.5500000e+02   1.0900000e+02   0.0000000e+00
   2.5500000e+02   1.1300000e+02   0.0000000e+00
   2.5500000e+02   1.1700000e+02   0.0000000e+00
   2.5500000e+02   1.2000000e+02   0.0000000e+00
   2.5500000e+02   1.2400000e+02   0.0000000e+00
   2.5500000e+02   1.2800000e+02   0.0000000e+00
   2.5500000e+02   1.3100000e+02   0.0000000e+00
   2.5500000e+02   1.3500000e+02   0.0000000e+00
   2.5500000e+02   1.3800000e+02   0.0000000e+00
   2.5500000e+02   1.4200000e+02   0.0000000e+00
   2.5500000e+02   1.4600000e+02   0.0000000e+00
   2.5500000e+02   1.4900000e+02   0.0000000e+00
   2.5500000e+02   1.5300000e+02   0.0000000e+00
   2.5500000e+02   1.5700000e+02   0.0000000e+00
   2.5500000e+02   1.6000000e+02   0.0000000e+00
   2.5500000e+02   1.6400000e+02   0.0000000e+00
   2.5500000e+02   1.6800000e+02   0.0000000e+00
   2.5500000e+02   1.7100000e+02   0.0000000e+00
   2.5500000e+02   1.7500000e+02   0.0000000e+00
   2.5500000e+02   1.7900000e+02   0.0000000e+00
   2.5500000e+02   1.8200000e+02   0.0000000e+00
   2.5500000e+02   1.8600000e+02   0.0000000e+00
   2.5500000e+02   1.8900000e+02   0.0000000e+00
   2.5500000e+02   1.9300000e+02   0.0000000e+00
   2.5500000e+02   1.9700000e+02   0.0000000e+00
   2.5500000e+02   2.0000000e+02   0.0000000e+00
   2.5500000e+02   2.0400000e+02   0.0000000e+00
   2.5500000e+02   2.0800000e+02   0.0000000e+00
   2.5500000e+02   2.1100000e+02   0.0000000e+00
   2.5500000e+02   2.1500000e+02   0.0000000e+00
   2.5500000e+02   2.1900000e+02   0.0000000e+00
   2.5500000e+02   2.2200000e+02   0.0000000e+00
   2.5500000e+02   2.2600000e+02   0.0000000e+00
   2.5500000e+02   2.3000000e+02   0.0000000e+00
   2.5500000e+02   2.3300000e+02   0.0000000e+00
   2.5500000e+02   2.3700000e+02   0.0000000e+00
   2.5500000e+02   2.4000000e+02   0.0000000e+00
   2.5500000e+02   2.4400000e+02   0.0000000e+00
   2.4700000e+02   2.4800000e+02   0.0000000e+00
   2.3900000e+02   2.5100000e+02   0.0000000e+00
   2.3100000e+02   2.5500000e+02   0.0000000e+00
   2.2300000e+02   2.5500000e+02   0.0000000e+00
   2.1500000e+02   2.5500000e+02   0.0000000e+00
   2.0700000e+02   2.5500000e+02   0.0000000e+00
   1.9900000e+02   2.5500000e+02   0.0000000e+00
   1.9100000e+02   2.5500000e+02   0.0000000e+00
   1.8300000e+02   2.5500000e+02   0.0000000e+00
   1.7500000e+02   2.5500000e+02   0.0000000e+00
   1.6700000e+02   2.5500000e+02   0.0000000e+00
   1.5900000e+02   2.5500000e+02   0.0000000e+00
   1.5100000e+02   2.5500000e+02   0.0000000e+00
   1.4300000e+02   2.5500000e+02   0.0000000e+00
   1.3500000e+02   2.5500000e+02   0.0000000e+00
   1.2800000e+02   2.5500000e+02   0.0000000e+00
   1.2000000e+02   2.5500000e+02   0.0000000e+00
   1.1200000e+02   2.5500000e+02   0.0000000e+00
   1.0400000e+02   2.5500000e+02   0.0000000e+00
   9.6000000e+01   2.5500000e+02   0.0000000e+00
   8.8000000e+01   2.5500000e+02   0.0000000e+00
   8.0000000e+01   2.5500000e+02   0.0000000e+00
   7.2000000e+01   2.5500000e+02   0.0000000e+00
   6.4000000e+01   2.5500000e+02   0.0000000e+00
   5.6000000e+01   2.5500000e+02   0.0000000e+00
   4.8000000e+01   2.5500000e+02   0.0000000e+00
   4.0000000e+01   2.5500000e+02   0.0000000e+00
   3.2000000e+01   2.5500000e+02   0.0000000e+00
   2.4000000e+01   2.5500000e+02   0.0000000e+00
   1.6000000e+01   2.5500000e+02   0.0000000e+00
   8.0000000e+00   2.5500000e+02   0.0000000e+00
   0.0000000e+00   2.5200000e+02   3.0000000e+00
   0.0000000e+00   2.4900000e+02   6.0000000e+00
   0.0000000e+00   2.4500000e+02   1.0000000e+01
   0.0000000e+00   2.4200000e+02   1.3000000e+01
   0.0000000e+00   2.3900000e+02   1.6000000e+01
   0.0000000e+00   2.3600000e+02   1.9000000e+01
   0.0000000e+00   2.3200000e+02   2.3000000e+01
   0.0000000e+00   2.2900000e+02   2.6000000e+01
   0.0000000e+00   2.2600000e+02   2.9000000e+01
   0.0000000e+00   2.2300000e+02   3.2000000e+01
   0.0000000e+00   2.1900000e+02   3.6000000e+01
   0.0000000e+00   2.1600000e+02   3.9000000e+01
   0.0000000e+00   2.1300000e+02   4.2000000e+01
   0.0000000e+00   2.1000000e+02   4.5000000e+01
   0.0000000e+00   2.0700000e+02   4.8000000e+01
   0.0000000e+00   2.0300000e+02   5.2000000e+01
   0.0000000e+00   2.0000000e+02   5.5000000e+01
   0.0000000e+00   1.9700000e+02   5.8000000e+01
   0.0000000e+00   1.9400000e+02   6.1000000e+01
   0.0000000e+00   1.9000000e+02   6.5000000e+01
   0.0000000e+00   1.8700000e+02   6.8000000e+01
   0.0000000e+00   1.8400000e+02   7.1000000e+01
   0.0000000e+00   1.8100000e+02   7.4000000e+01
   0.0000000e+00   1.7800000e+02   7.7000000e+01
   0.0000000e+00   1.7400000e+02   8.1000000e+01
   0.0000000e+00   1.7100000e+02   8.4000000e+01
   0.0000000e+00   1.6800000e+02   8.7000000e+01
   0.0000000e+00   1.6500000e+02   9.0000000e+01
   0.0000000e+00   1.6100000e+02   9.4000000e+01
   0.0000000e+00   1.5800000e+02   9.7000000e+01
   0.0000000e+00   1.5500000e+02   1.0000000e+02
   0.0000000e+00   1.5200000e+02   1.0300000e+02
   0.0000000e+00   1.4800000e+02   1.0700000e+02
   0.0000000e+00   1.4500000e+02   1.1000000e+02
   0.0000000e+00   1.4200000e+02   1.1300000e+02
   0.0000000e+00   1.3900000e+02   1.1600000e+02
   0.0000000e+00   1.3600000e+02   1.1900000e+02
   0.0000000e+00   1.3200000e+02   1.2300000e+02
   0.0000000e+00   1.2900000e+02   1.2600000e+02
   0.0000000e+00   1.2600000e+02   1.2900000e+02
   0.0000000e+00   1.2300000e+02   1.3200000e+02
   0.0000000e+00   1.1900000e+02   1.3600000e+02
   0.0000000e+00   1.1600000e+02   1.3900000e+02
   0.0000000e+00   1.1300000e+02   1.4200000e+02
   0.0000000e+00   1.1000000e+02   1.4500000e+02
   0.0000000e+00   1.0700000e+02   1.4800000e+02
   0.0000000e+00   1.0300000e+02   1.5200000e+02
   0.0000000e+00   1.0000000e+02   1.5500000e+02
   0.0000000e+00   9.7000000e+01   1.5800000e+02
   0.0000000e+00   9.4000000e+01   1.6100000e+02
   0.0000000e+00   9.0000000e+01   1.6500000e+02
   0.0000000e+00   8.7000000e+01   1.6800000e+02
   0.0000000e+00   8.4000000e+01   1.7100000e+02
   0.0000000e+00   8.1000000e+01   1.7400000e+02
   0.0000000e+00   7.7000000e+01   1.7800000e+02
   0.0000000e+00   7.4000000e+01   1.8100000e+02
   0.0000000e+00   7.1000000e+01   1.8400000e+02
   0.0000000e+00   6.8000000e+01   1.8700000e+02
   0.0000000e+00   6.5000000e+01   1.9000000e+02
   0.0000000e+00   6.1000000e+01   1.9400000e+02
   0.0000000e+00   5.8000000e+01   1.9700000e+02
   0.0000000e+00   5.5000000e+01   2.0000000e+02
   0.0000000e+00   5.2000000e+01   2.0300000e+02
   0.0000000e+00   4.8000000e+01   2.0700000e+02
   0.0000000e+00   4.5000000e+01   2.1000000e+02
   0.0000000e+00   4.2000000e+01   2.1300000e+02
   0.0000000e+00   3.9000000e+01   2.1600000e+02
   0.0000000e+00   3.6000000e+01   2.1900000e+02
   0.0000000e+00   3.2000000e+01   2.2300000e+02
   0.0000000e+00   2.9000000e+01   2.2600000e+02
   0.0000000e+00   2.6000000e+01   2.2900000e+02
   0.0000000e+00   2.3000000e+01   2.3200000e+02
   0.0000000e+00   1.9000000e+01   2.3600000e+02
   0.0000000e+00   1.6000000e+01   2.3900000e+02
   0.0000000e+00   1.3000000e+01   2.4200000e+02
   0.0000000e+00   1.0000000e+01   2.4500000e+02
   0.0000000e+00   6.0000000e+00   2.4900000e+02
   0.0000000e+00   3.0000000e+00   2.5200000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
   0.0000000e+00   0.0000000e+00   2.5500000e+02
A.JPG
b.JPG

  Re: about the colorbar
Posted by Peter Kwan on Aug-02-2023 18:38
Attachments:
Hi Tom,

I think your gradient can be defined with 16 colors as follows (I just read them from color.txt manually) :

int colorGradient[] = { 0x0000FF, 0x0000FF, 0x001DE2, 0x0054AB, 0x008B74, 0x00C23D, 0x00FE00, 0x7FFF00,
    0xFFF000, 0xFFC800, 0xFF7500, 0xFF3700, 0xFF000A, 0xFF0065, 0xFF0064, 0xFF0064 };

int colorGradientLen = (int)(sizeof(colorGradient) / sizeof(*colorGradient));

c->setColorAxis(645, 270, Chart::Left, 200, Chart::Right)
    ->setColorGradient(true, IntArray(colorGradient, colorGradientLen), Chart::Transparent, Chart::Transparent);


For your code, it seems you are dividing the RGB color intensity with 255, then multiply it by CalPhaseDlg.PV. I think it is not necessary.

In ChartDirector, the color can be written as a 6 digit hex number which in C++ syntax is 0xRRGGBB. The Microsoft RGB uses a different format 0xBBGGRR. It is better to just compose the colors directly in C++:

// Red/Green/Blue are integers from 0 to 255
int RGB = (Red << 16) | (Green << 8) || Blue;

If you just want to use the colors for minZ to maxZ, regardless of the actual values of minZ and maxZ, then it can be treated as a "color gradient". In this case, you do not need to provide the data values.

If you want certain colors for certain values, regardless of what are the actual data or axis range, then it is a "color scale". For example, if you are measuring body temperature and you want values higher than 104F to be red because it is high fever (even though the actual data may not have any value higher than 104F), then it is a color scale. In this case, you have to specify both the data values and the colors.

Best Regards
Peter Kwan
mfcdemo_20230802180334.jpg

  Re: about the colorbar
Posted by Tom on Aug-02-2023 23:01
Attachments:
Hi, Peter,

Thank you so much for your kindly help. Now the problem is solved. Yes, I misunderstood the example program. And without given specific values range, it is much more convenient.

By the way, there are some points on the edge of the circle as shown on the attached figure.  It does not looks beautyful. How to remove them? You explain the problem before. But there are still few points like these.

best regards
c.JPG

  Re: about the colorbar
Posted by Peter Kwan on Aug-03-2023 19:38
Hi Tom,

My guess is that it is due to the z data. For testing, you can try not to use the w data like:

// Comment out the w data
c->setData(dataX, dataY, dataZ  /* , dataW */ );

You can then see the actual shape of the surface. I suspect the points at the edges are due to the z data at the edges.

To eliminate the these points, we must entire the z data is "smooth" at the edges, and not change wildly. After some thoughts, I think the best way is to set the z data at the masked out positions to the same value as the nearest point. To do this, I come up with the following algorithm:

//
// Note: In my test code, I use std::vector<double> for xData, yData, zData and wData
//

// To begin, make sure the zData is the same as the wData.
std::vector<double> zData = wData; // This makes a copy of the wData

//
// Change the -999 points in the zData to the value of the nearest points
//

// Scan the points horizontally in both directions
for (int y = 0; y < yData.size(); ++y) {
    int offset = y * xData.size();
    for (int x = 1; x < xData.size(); ++x) {
        if (zData[offset + x] == -999)
    zData[offset + x] = zData[offset + x - 1];
    }
    for (int x = xData.size() - 2; x >= 0; --x) {
        if (zData[offset + x] == -999)
    zData[offset + x] = zData[offset + x + 1];
    }
}

// Scan the points vertically in both directions
// (Depending on your data, this may not be necessary.)
for (int x = 0; x < xData.size(); ++x) {
    for (int y = 1; y < yData.size(); ++y) {
        int coor = y * xData.size() + x;
        if (zData[coor] == -999)
            zData[coor] = zData[coor - xData.size()];
    }
    for (int y = yData.size() - 2; y >= 0; --y) {
        int coor = y * xData.size() + x;
        if (zData[coor] == -999)
    zData[coor] = zData[coor + xData.size()];
    }
}

// Now can use the data
c->setData(DoubleArray(xData.data(), xData.size()), DoubleArray(yData.data(), yData.size()),
    DoubleArray(zData.data(), zData.size()), DoubleArray(wData.data(), wData.size()));


Please try the above to see if it can solve the problem.

Best Regards
Peter Kwan

  Re: about the colorbar
Posted by Tom on Aug-04-2023 19:15
Hi,Peter,

Thank you very much for your kindly help. The problem is solved now. You are great!!! Thanks a lot.

best regards