MSChart Secondary AxisX2 AxisY2 Line Painting Location To Right and Upper Corner HowTo - mschart

Hello i am new to world of MSChart and was wondering why
LineColor, LineDashStyle, LineWidth of Secondary AxisX2 and AxisY2 keeps overlay on top at Primary AxisX and AxisY ?
MajorTickMark and MinorTickMark are shown as expected at top and right side of ChartArea,
Is it possible to Locate Line Style of Secondary Axes X2 Y2 to align at top and right side of ChartArea aswell some how ?
I was think of to use the chart1_PostPaint event to get this Line rectangle of X2 and Y2 being painted at top and right side location i looked at this event but even i don't have a clue if this is possible and right way to re locate the line painting of Secondary set of axes
Thanks in advance

At APP: Over 200 Interactive Samples Of MSChart
At Sample: Contents|Appearance: Axis Line Appearance
Located At: \ChartFeatures\Axis\Appearance\cscode.txt
Is actually doing what i am looking for, the AxisY2 LineColor is painted at right side of chartarea
I looked at it's code but still find no clue how to align this AxisY2 Line to right side ??
hmmm i did set AxisX2 Crossing to zero maybe i should set this one to a higher max value
Now AxisY2 Line Color is located at zero instead of showing at right side aswell as its labels already do
Sorry to abuse this answer but i did try comments first
but comments function at this message board is stripping new lines and answer function is stripping new lines aswell some how

Yeah set crossing of AxisX2 to appear AxisY2 at right side or move it anywhere,
solved it, what i was looking for

Related

Why is my line not showing up? [inkscape]

Just getting into Inkscape. When I use the pencil or "Draw Bezier lines.." buttons, I follow the instructions in the manual to get the intended effect to get a horizontal or vertical line.
Except, I cannot see the line itself. In the examples the line shows up, but after I stop highlighting it, it goes away completely. The other lines turn out fine. Below is a picture of my screen.
image
My opacity, and alpha are correct for the line segment (as you can see from the screenshot), so I was wondering what I'm doing wrong here.
Thanks!
Try setting a stroke instead of a fill. And make sure you are in a visible layer.

How to detect mouse hover over a line plot in Qt?

I am new to C++,Qt and Visual Studio and this is my first post on Stack Overflow.
I apologize in advance if this is a repeated question, I tried searching for a similar question but couldn't find one. Let me know if this is a repeated question and I will delete it.
I am trying to create a line plot using QWidget::paintEvent(). The line plot I am drawing is actually a QPainterPath. I want to detect when the mouse hovers over my line plot and so I create a small rectangle where my mouse cursor is and detect when this rectangle intersects with my line plot using bool QPainterPath::intersects() function. The problem is that this function returns true even when my mouse is not exactly over my line plot. In the Image 1 (I am not allowed to embed images yet) my line plot is the thick black curve and the bool QPainterPath::intersects() returns true even when my cursor is over the yellow region. As per the Qt document this is because:
There is an intersection if any of the lines making up the rectangle crosses a part of the path or if any part of the rectangle overlaps with any area enclosed by the path.
There is no way to have a QPainterPath without any enclosed area as Qt only provides two types of fill for QPainterPath: Qt::OddEvenFill or Qt::WindingFill. (To be honest, I find this kind of annoying, since an open path is a series of line segments connected end-to-end, if someone wants to enclose an area they can easily connect the first and last point using either QPainterPath::lineTo() or QPainterPath::moveTo() functions)
Anyway, I decided to get smarter than Qt and drew two extra QPainterPath with pathUp being a few pixels above my line plot and pathDn being a few pixels below my line plot. Image 2 shows these 3 line plots, red one is pathUp, black one is real line plot and green one is pathDn. I thought I coould detect the intersection in the QWidget::mouseMoveEvent() by using the following code:
// cRect: Rectangle at mouse cursor position
if((pathUp.intersects(cRect) && (!pathDn.intersects(cRect))) || ((!pathUp.intersects(cRect)) && pathDn.intersects(cRect)))
{
qDebug() << "Intersects";
}
But this still produces wrong results because now the enclosed area is different, as you can see in Image 3 the green area is an enclosed area of pathDn and red area is the enclosed area of pathUp. The thick black curve is again the line plot that I want to detect my mouse hover on. This enclosed area is not affected by Qt::setFillRule of QPainterPath.
What's even more frustrating is that I tried this technique using QPolygonF instead of QPainterPath on QWidget and the results were exactly the same. I also tried QGraphicsView, there I used QGraphicsPathItem to create my line plot and then used QGraphicsScene::focusItemChanged() signal to detect when I click on my line plot. It again produced the same result of detecting the click when my cursor is over the enclosed area. I do not want to create a custom QGraphicsItem (unless I absolutely have to) just to reimplement it's hoverEnterEvent() and hoverLeaveEvent() method because of the limitations imposed on the boundingRect() of the QGraphicsItem as explained in Qt Docs:
QGraphicsScene expects all items boundingRect() and shape() to remain unchanged unless it is notified. If you want to change an item's geometry in any way, you must first call prepareGeometryChange() to allow QGraphicsScene to update its bookkeeping.
Since I making a plot in real-time the boundingRect() will change quite frequently (> 20 Hz), which will result in an extra computational burden on the software. Is there any way I can solve my problem without creating a custom QGraphicsItem?
P.S. I have been using Stack Overflow for many years whenever I got stuck. I just never made an account here because I never needed to post anything. You guys are the best and I am very happy to be a part of this community!

Bar chart label alignment

My labels are aligning to the left side of my bars. I'm wanting them centered but I can't figure out how to make it happen. I checked the docs but I couldn't find the answer. Anyone know how to center them?

Fuse cells in QGridLayout

I'm working on a Qt project and I'm struck on a QtDesign issue.
I've at the moment a 4x4 grid, like that:
Top Left (TL): SourceSelector
Top Right (TR): groupBox_vizualization
Bottom Left (BL): groupBox_filtrage
Bottom Right (BR): groupBox_spectre
I would like the SourceSelector to have a 100% width when I select one of the widgets in stackWidget_source. At the moment, when I select this widget I set the width of the "vizualisation" widget to 0, and hide it. I would like the SourceSelector to use 100% of the width in that case only. I order to have a grid (2)x(1 1).
But TL/BL et TR/BR always have the same width. So I can't make the TR one to use 100% as the BR has a fixed size.
Do you guys have any idea ?
Well, I solved my problem with a Grid Layout at the bottom and a HLayout at the top. Both of them placed in a VLayout.

How do I draw a line on a Lazarus form?

I often use a TPanel or TGroupBox to group my form controls.
Now I need to draw just a straight line like the border of a Panel or GroupBox.
How do I do this on LAZARUS?
Thanks in advance!
Note: The technique must work on both Linux and Windows
As an optical line separator you should use either the TBevel component with Shape property set to one of the following values bsTopLine, bsBottomLine, bsLeftLine or bsRightLine depending on which line you currently need and resize it to a smaller size (in your case you can use bsTopLine or bsBottomLine and resize the bevel vertically):
Or you can use a special component called TDividerBevel which except the single line adds to this optical divider also a caption:
Here's what I've finally done but I'm not sure if this is the RIGHT way so I won't accept my answer. If there's someone else who can point out any issues with this, please let me know. I found this pretty straightforward as well :)
Place a TGroupBox on the form.
Leave the Caption property blank. Now it should look like a panel with only borders.
Use the mouse and drag the bottom border towards the top. Now it looks like a line.
Well, I personally think this method is NOT efficient as it would take up more memory space than just a real straight line. Anyway, so far it seems to work for me :)
Here's the screenshot - look towards the bottom (just above the last text box). The only issues is that on the sides of the line, it shows the lines bending. I think I should set the properties correctly than dragging with the mouse.