Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart3D 3D Charting Tools for .Net (VB and C#)
 X Axis Grid not aligned to chart axis
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jules

10 Posts

Posted - 24 Oct 2010 :  07:38:42  Show Profile  Reply with Quote
Hello,

Grid on X Axis not aligned to chart.

Looked through the examples unable to find out why.

Recently upgraded to VS2010, the grid was aligned in the VS2008 solution.

Initialize Chart Method:


 // dataset for the solutions
                SimpleDataset3D dataset = new SimpleDataset3D("First Plot", xPoints, yPoints, zPoints);

                // scale coordinate system for data
                SimpleDataset[] datasetarray = { dataset };

                pTransform1 = new CartesianCoordinates(ChartObj.LINEAR_SCALE, ChartObj.LINEAR_SCALE);
                pTransform1.AutoScale(datasetarray, ChartObj.AUTOAXES_FAR, ChartObj.AUTOAXES_FAR, ChartObj.AUTOAXES_FAR);

                // position chart in graph area
                pTransform1.SetGraphBorderDiagonal(0.2, .2, .80, 0.725);

                // setting for cube representation of chart
                //pTransform1.SetGraphBorderDiagonal(0.15, 0.15, 0.85, 0.85); 
                //chartView.SetFractionalZViewportDepth(0.5);

                // set rotational parameters
                pTransform1.AbsRotateCoordinateSystem(new Point3D(10, 15, 0));

                // define chart background
                Background background = new Background(pTransform1, ChartObj.GRAPH_BACKGROUND, Color.White);
                chartView.AddChartObject(background);

                // define walls
                ChartAttribute wallAttrib = new ChartAttribute(Color.Black, 1, DashStyle.Solid, Color.AliceBlue);
                Wall3D xyMinZWall = new Wall3D(pTransform1, ChartObj.XY_MAXZ_PLANE, 0.02, wallAttrib);
                chartView.AddChartObject(xyMinZWall);
                Wall3D yzMinXWall = new Wall3D(pTransform1, ChartObj.YZ_MINX_PLANE, 0.02, wallAttrib);
                chartView.AddChartObject(yzMinXWall);
                Wall3D xzMinYWall = new Wall3D(pTransform1, ChartObj.XZ_MINY_PLANE, 0.02, wallAttrib);
                chartView.AddChartObject(xzMinYWall);

                // define x-, y-, and z-axes
                LinearAxis xAxis = new LinearAxis(pTransform1, ChartObj.X_AXIS);
                chartView.AddChartObject(xAxis);

                LinearAxis yAxis = new LinearAxis(pTransform1, ChartObj.Y_AXIS);
                chartView.AddChartObject(yAxis);

                LinearAxis zAxis = new LinearAxis(pTransform1, ChartObj.Z_AXIS);
                zAxis.AxisIntercept2 = yAxis.AxisMin;
                chartView.AddChartObject(zAxis);

                // define x-, y-, and z-axis labels
                NumericAxisLabels xAxisLab = new NumericAxisLabels(xAxis);
                xAxisLab.SetTextFont(theFont);
                chartView.AddChartObject(xAxisLab);

                NumericAxisLabels yAxisLab = new NumericAxisLabels(yAxis);
                yAxisLab.SetTextFont(theFont);
                chartView.AddChartObject(yAxisLab);

                NumericAxisLabels zAxisLab = new NumericAxisLabels(zAxis);
                zAxisLab.SetTextFont(theFont);
                chartView.AddChartObject(zAxisLab);

                // define x-, y-, and z-axis titles
                Font titleFont = new Font("Microsoft Sans Serif", 10, FontStyle.Bold);
                AxisTitle yaxistitle = new AxisTitle(yAxis, titleFont, yName);
                chartView.AddChartObject(yaxistitle);

                AxisTitle xaxistitle = new AxisTitle(xAxis, titleFont, xName);
                chartView.AddChartObject(xaxistitle);

                AxisTitle zaxistitle = new AxisTitle(zAxis, titleFont, zName);
                chartView.AddChartObject(zaxistitle);

                // define x-, y-, z- grids
                Grid xgrid = new Grid(xAxis, yAxis, ChartObj.X_AXIS, ChartObj.GRID_MAJOR);
                chartView.AddChartObject(xgrid);

                Grid ygrid = new Grid(xAxis, yAxis, ChartObj.Y_AXIS, ChartObj.GRID_MAJOR);
                chartView.AddChartObject(ygrid);

                Grid zgrid = new Grid(xAxis, yAxis, zAxis, ChartObj.Z_AXIS, ChartObj.GRID_MAJOR);
                zgrid.GridAxisPlane = ChartObj.XZ_MINY_PLANE;
                chartView.AddChartObject(zgrid);

                // chart symbols
                ChartAttribute attrib1 = new ChartAttribute(Color.Blue, 1, DashStyle.Solid);
                attrib1.SetFillColor(Color.Blue);
                attrib1.SetFillFlag(true);
                attrib1.SetSymbolSize(8);

                // define first plot as a simple scatter plot
                SimpleScatterPlot thePlot1 = new SimpleScatterPlot(pTransform1, dataset, ChartObj.PYRAMID3D, attrib1);
                chartView.AddChartObject(thePlot1);

                // define legend
                Font legendFont = new Font("Microsoft Sans Serif", 14, FontStyle.Bold);
                ChartAttribute legendAttributes = new ChartAttribute(Color.Gray, 1, DashStyle.Solid);
                legendAttributes.SetFillFlag(false);
                legendAttributes.SetLineFlag(false);
                StandardLegend legend = new StandardLegend(0.2, 0.875, 0.8, 0.075, legendAttributes,
                                                           StandardLegend.HORIZ_DIR);
                legend.AddLegendItem("Solutions", thePlot1, legendFont);
                legend.SetLegendItemUniformTextColor(Color.Black);
                chartView.AddChartObject(legend);

                // define title
                Font chartTitleFont = new Font("Microsoft Sans Serif", 18, FontStyle.Bold);
                ChartTitle mainTitle = new ChartTitle(chartTitleFont, "Title");
                mainTitle.SetTitleType(ChartObj.CHART_HEADER);
                mainTitle.SetTitlePosition(ChartObj.CENTER_GRAPH);
                chartView.AddChartObject(mainTitle);

                // chart footer - instructions
                Font theFooterFont = new Font("Microsoft Sans Serif", 12, FontStyle.Bold);
                const string footerText = "Footer";
                ChartTitle footer = new ChartTitle(theFooterFont, footerText);
                footer.SetTitleType(ChartObj.CHART_FOOTER);
                footer.SetTitlePosition(ChartObj.LEFT_SIDE);
                footer.SetTitleOffset(0);
                chartView.AddChartObject(footer);
                chartView.SetResizeMode(ChartObj.AUTO_RESIZE_OBJECTS);

                // configure tooltip method
                ConfigureCustomTooltip();

                // cntrl key + left button rotate mouse listener
                RotateChartMouseListener rotateMouseListener = new RotateChartMouseListener(chartView, MouseButtons.Right,
                                                                                            pTransform1);
                rotateMouseListener.SetEnable(true);
                rotateMouseListener.KeyFilter = MouseListener.FilterKeys.CTRL_KEY;
                chartView.AddMouseListener(rotateMouseListener);

                // define a zoom object using a custom zoom class
                double zpos = 0.0;
                CartesianCoordinates[] transformArray = { pTransform1 };
                ZoomWithStack zoomObj = new ZoomWithStack(chartView, transformArray, zpos, true);
                zoomObj.KeyFilter = MouseListener.FilterKeys.SHIFT_KEY; 
                zoomObj.SetButtonMask(MouseButtons.Left);
                zoomObj.SetZoomYEnable(true);
                zoomObj.SetZoomXEnable(true);
                
                zoomObj.SetZoomXRoundMode(ChartObj.AUTOAXES_FAR);
                zoomObj.SetZoomYRoundMode(ChartObj.AUTOAXES_FAR);
                zoomObj.SetEnable(true);
                zoomObj.SetZoomStackEnable(true);
                zoomObj.SetZoomRangeLimitsRatio(new Dimension3D(0.001, 0.001));
                chartView.SetCurrentMouseListener(zoomObj);
            }


Commented out 'Grid xgrid ' the chart then lost its diagonal grid line on the X Axis.

Thanks, Jules

Jules

10 Posts

Posted - 25 Oct 2010 :  04:08:12  Show Profile  Reply with Quote

Should I be update ChartObj.XY_MAXZ_PLANE... with other wall orientation?

// define walls
ChartAttribute wallAttrib = new ChartAttribute(Color.Black, 1, DashStyle.Solid, Color.AliceBlue);
Wall3D xyMinZWall = new Wall3D(pTransform1, ChartObj.XY_MAXZ_PLANE, 0.02, wallAttrib);
chartView.AddChartObject(xyMinZWall);
Wall3D yzMinXWall = new Wall3D(pTransform1, ChartObj.YZ_MINX_PLANE, 0.02, wallAttrib);
chartView.AddChartObject(yzMinXWall);
Wall3D xzMinYWall = new Wall3D(pTransform1, ChartObj.XZ_MINY_PLANE, 0.02, wallAttrib);
chartView.AddChartObject(xzMinYWall);
Go to Top of Page

quinncurtis

1555 Posts

Posted - 25 Oct 2010 :  08:55:20  Show Profile  Reply with Quote
It is not clear, is this directly from one of our examples? If it is, which example is it. If not, can you supply us with a project which reproduces the problem (send it to support@quinn-curtis.com). Do you still maintain that this is a problem which can only be reproduced under Windows 7?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07