MSChart HowTo Create a Second CursorX to have multiple Cursor by a second Transparant ChartArea? - mschart

I am try to introduce a Second CursorX at AxisX Primary if this is possible some how?
I did try to activate a second CursorX at Secondary but that one did not work as expected,
I also readed about Line Annotation and Vertical Line Annotation and created some kind of line but a Second set of CursorX CursorY would be far nicer
I did try to create and as much as empty as possible and Transparant Second ChartArea which i try to overlay on top of the ChartArea1, i noticed InnerPlotPosition and Postion of both ChartArea should stay in track to get a full aligned Overlay, and next the CursorX of second ChartArea should be displayed on top of ChartArea1
This is what i think how it could be done but don't have a clue if it sounda for a good way to create a second CursorX maybe Line Annotation is an easier road to rome
Any help suggestion are welcome
Thanks in advance

Suppose your chart contains multiple chart areas aligned vertically, below code allows you set CursorX in each chart area:
Dim c1 As New Chart
'...here code block to build each chart area ...
'...then use below sample code to align each chart area vertically:
'c1.ChartAreas(i).AlignmentOrientation = AreaAlignmentOrientations.Vertical
'c1.ChartAreas(i).AlignWithChartArea = c1.ChartAreas(0).Name
'below set horizontal cursor (it is a gold vertical bar in each chart area):
For Each area As ChartArea In c1.ChartAreas
area.CursorX.LineColor = Color.Gold
area.CursorX.LineWidth = 3
area.CursorX.IsUserEnabled = True
area.CursorX.IsUserSelectionEnabled = True
area.CursorX.SelectionColor = System.Drawing.Color.PaleGoldenrod
Next

Related

wxPython Toolbook/Toolbar, blank space between toolbar and frame

The screenshot is a snip of the left side of my main frame. This frame has a toolbook at the top. I've set the background color of both the toolbar in the toolbook and the frame to 0,0,0 but, as you can see, there is a small blank line between the two. How do I get that line gone or how do I make it black, as well?
As a quick side question -- is there a way to change the color of the "selected" halo on the toolbar to something a bit more contrasted for black? You can see the very faint blue halo around that first icon, I'd like that to be a much lighter blue, if possible.
EDIT: Code added --
il = wx.ImageList(128, 128)
for tab in self.package.vars["tabs"]:
il.Add(wx.Image(self.package.vars["iconPath"].format(tab), wx.BITMAP_TYPE_PNG).ConvertToBitmap())
self.AssignImageList(il)
imageIdGenerator = self.getNextImageID(il.GetImageCount())
pages = [(wx.Panel(parent = self.parent, id = wx.ID_ANY), name.capitalize()) for name in self.package.vars["tabs"]]
imID = 0
toolbar = self.GetToolBar()
toolbar.SetBackgroundColour(self.package.vars["bgColor"])
toolbar.AddStretchableSpace()
for page, label in pages:
self.AddPage(page, label, imageId=imageIdGenerator.next())
page.SetBackgroundColour(c.COLORS["green"])
imID += 1
toolbar.AddStretchableSpace()
pages = [(wx.Panel(parent = self.parent, id = wx.ID_ANY), name.capitalize()) for name in self.package.vars["tabs"]]
maybe this wx.Panel in the list comprehension still has the default color. what happens if you apply SetBackgroundColour to these panels as well?
(edit)
How about removing that boarder space by
self.SetInternalBorder(0)
self here is Toolbook class. It seems to work on wxPython Demo Toolbook example.

Position title Aspose slide chart

Is it possible to position the title of a Aspose powerpoint slide chart?
I have tried following:
chart.ChartTitle.X = 100;
chart.ChartTitle.Y = 100;
With different values but title is not moved.
Since it is not possible to move the chart title I simply created a title just above the chart using a regular autoshape, something like this:
IAutoShape autoshape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 20, 0, 600, 50);
autoshape.UseBackgroundFill = true;
autoshape.LineFormat.FillFormat.FillType = FillType.NoFill;
autoshape.AddTextFrame(" ");
ITextFrame txtFrame = autoshape.TextFrame;
IParagraph para = txtFrame.Paragraphs[0];
IPortion portion = para.Portions[0];
portion.Text = title;
portion.PortionFormat.FillFormat.SolidFillColor.Color = Color.Black;
portion.PortionFormat.FillFormat.FillType = FillType.Solid;
I have observed the code shared by you and it is Ok despite the values set for it. Inside the chart area the value is between 0-1. (0,0)(X,Y) being the bottom left and (1,1)(X,Y) being top right corner of chart. But still this feature is not working and there seems to be issue in API. You can contact Aspose.Slides support team over following link to log request for your issue.
http://www.aspose.com/community/forums/aspose.slides-product-family/109/showforum.aspx
Yes, you are right. This is an alternate approach that you may try on your end to super impose an auto shape containing the chart title as overlay on the chart. However, in this approach you need to identify the appropriate position of auto shape over the chart to serve as title.
Yes this is one of the alternates that you can use on your end.

Text Wrapping in Cocos2d-x

I am trying to get my text labels to automatically resize if the text is longer than the box they are in. I also want it to support multi-line functionality. I have done some searching online and saw that it used to work something like this:
CCLabelTTF::labelWithString(“This is a sentence longer than a line width.2d-x”, CGSizeMake(**0, 0**), UITextAlignmentCenter, “Thonburi”, 20);
but that seems to no longer be available in cocos so I am not sure what to do.. Right now I have my label set up as follows:
myQuestion = Label::createWithTTF("Testing to see if text wrap will work" ,c_strFontNameBase, 50);
myQuestion->setPosition(boxLabel->getContentSize().width/2, boxLabel->getContentSize().height/2);
boxLabel->addChild(myQuestion, 50);
Is there some way I can use a similar way to the top example to make mine work? This doesn't seem like it should be very hard thing to do but I am finding a lack of documentation on it online...
I believe, you can only make one dimension of the label auto-resizable i.e. either width or height can be auto-resizable. By default when you create label as follows, width of the labels are set to resize automatically with fixed height:
auto label = Label::createWithTTF("Hello World gsdhsgdh gshdghsg yutywe gdgshdgy bnbjh hshhashgy hjnbdnsdhh ghhsgdhg ghghghsd ghhghsd ghghghgsd jkjkhsdjkj ououisdusydsi kkjkxncmxcjh kcxhjxhcjx jkuiushjxchxjch hjhjchxuyuychjc ", "fonts/Marker Felt.ttf", 24);
// position the label on the center of the screen
label->setPosition(Vec2(origin.x + visibleSize.width/2,
origin.y + visibleSize.height - label->getContentSize().height));
// add the label as a child to this layer
this->addChild(label, 1);
But if you want multi-line support i.e. fixed width and resizable height you just need to set dimension of the label with fixed width and zero height as:
label->setDimensions(300, 0);
I hope it will help.

Google Chart - Bar chart with label underneath

I'm trying to create something close to this using Google Chart API:
So far, I've got this:
<img src="//chart.googleapis.com/chart?
chbh=a
&chs=461x337
&cht=bvg
&chco=323232,7bc247&c
&chd=e:zM,Mz" width="461" height="337" alt="" />
Which generates this
http://jsfiddle.net/alexjamesbrown/c2VAP/
Which is almost there, but I can't figure out how / if I can add a label underneath the bars?
If you want to get labels like that, you have to make a few changes. Set the following chart parameters:
cht=bvs // create a stacked chart
chd=zM__,__Mz // insert null values for the opposite data points
chxt=x // create an x-axis
hxl=0:|Label+1|Label+2 // set the labels on the x-axis ("+" translates to a space)
see example: http://jsfiddle.net/asgallant/c2VAP/2/

Is there any way to add gridlines to a gRaphael line chart?

I have a line chart that I've created with gRaphael. It has axes and tick marks, but I'd like to have grid lines. Is there built-in way to achieve this or an add on library that can help me?
gRaphael does not have a built-in way to add grid lines, but it is pretty easy to draw them, either by editing the source code or manipulating your graph object after you create it.
I had found an extension called RaphAlytics and used its drawGrid() function in cases where I needed a bounding box with a grid.
You can adapt this function for any gRaphael graph as needed to draw gridlines. On a line chart, I needed to draw horizontal gridlines that were aligned with the left axis marks on a line chart, so I used the function as an example like this:
// Draw horizontal gridlines
for (var i = 0; i < g.axis[1].text.items.length; i++) {
r.path(['M', x, g.axis[1].text.items[i].attrs.y, 'H', w + x]).attr({
stroke : '#EEE'
}).toBack();
}
Here's a working fiddle to illustrate that example: http://jsfiddle.net/KM3BB/1/
I tried doing this yesterday. Short answer: gRaphaël can't do this for you with any linechart options nor axis options, you have to do-it-yourself with Raphaël.
Something like:
var r = Raphael("holder"), txtattr = { font: "12px sans-serif" };
r.path('M 15 200.5 L 310 200.5 M 15 180.5 L 310 200.5');
r.linechart(10, 10, 300, 220, x, [y, y2, y3]);
This means under my linechart draw a path which starts from 15,200.5 and draws a straight line to 310,200.5 moves to 15,180.5 and draws a line to 310,180.5. Don't ask me why but the .5 is important for getting the stroke to actually be 1px wide and solid black. Otherwise it seems to get aliased to 2px wide at 50% opacity. You have to calculate the exact placement in regards to your linechart yourself.
You can also play with the path function in the playground by changing r to paper.
You might also consider looking at Google Chart Tools if your looking for things like defining the exact range of the axis (as opposed to just the min and max of the input).