Reachart minPointSize props does not work when using in stackedBarChart - recharts

Problem: I am working on stackedBarChart where on particular data if there is no data we need show dash as a indication there but there is data normal we have to show stackedBar
but when trying to show dash using minpointsize prop of stackedbarchart it does not work properly , it shows up even when there is data.

Related

MS Teams List Card

Do list cards in teams still work?
I want to try out a simple list card with support for scrolling.
However, I cannot get it working in App Studio(Card Editor) or from the code.
I do not see any way of sending a list card using CardFactory as well.
Yes, they definitely still do work, I happened to test one this morning. You're right though that App Studio's Card Editor doesn't support them though, and CardFactory doesn't have a mechanism for them either, so you either need to create the JSON object explicitly, or use a JSON string.
I'm using C#, so can't send you a code sample, but it should just be a case of making sure your final output matches the correct format for List Cards
The list card sample json is here - https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-reference#list-card
This cannot be tested in the Adaptive cards designer - https://adaptivecards.io/designer
I got this working by using the following code in Java
Attachment attachment = new Attachment();
attachment.setContentType("application/vnd.microsoft.teams.card.list");
attachment.setContent(createCardJson("ListCard.json")));
Activity act=MessageFactory.attachment(attachment);
We have to change the ListCard.json to just have the content part of the json (from the link above) stored with the file. The content type is set with the attachment object

How to store and retrieve data from an optional array of integers using core-data?

I've developed an iPhone app that is working fine except for navigating from one view to another without losing the data. I know that core-data is the solution but I'm a beginner in this area. I need to store and retrieve several arrays such as: var arrayName = [Int?] (repeating: nil, count: 9) in the exact order they become populated (0-8). How do I set these existing arrays up in core-data?
I've watched and read several tutorials, but none explain how to include an array (especially with integers) that already exists.
All of my code is working perfectly for this app. I only need to save the data.
I expect to be able to navigate from view to view and return with everything in place. Also to close and reopen the app where I left off.
Note: No need for error messages.

Lat/Lng Coordinate variables not recognized in ActiveRecord, forced to hard code

Hey guys I'm having the WEIRDEST issue while pairing on this rails app. We're using google maps api to grab lat and lng to do an ActiveRecord look up. For some odd reason the SomeModel.where("lat <=?", neLat) will not work BUT when I print neLat to the console and then copy the number and then hard code it to that query it works perfectly! I'm so stumped. Has anyone had any issues like this before?
This is an example of what I'm currently doing which doesn't work:
data = request.parameters
neLat = data['neLat'].to_f
#props = SomeModel.where("lat <=?", neLat)
47.6090933689332 is the number I see in my console/ActiveRecord query. One troubleshooting step I've taken was hard coding the number into a variable like this:
neLat = 47.6090933689332
#props = SomeModel.where("lat <=?", neLat)
I get the results I'm looking for this way, but I don't want to be hardcoding these coordinates. Another troubleshooting step I've taken was to make sure there wasn't a conflict with the float value so I went with this:
temp = "47.6090933689332"
neLat = temp.to_f
#props = SomeModel.where("lat <=?", neLat)
This didn't work either as it gave me the same results as the example just above.
EDIT:
I've provided more details as requested in the comments. Also, I realized I wasn't as clear as I could've been in my initial question. When I query I'm able to get my desired results back in the console, but the problem lies in the rendering of the results in my view. Any form of hardcoding will render correctly in my view, but when I use the values from my request.parameters is where the rendering fails. It will either render everything in the table or nothing in the table. So in the example below I can see that I'm getting 3 different properties from my properties table, but my view will render EVERYTHING in my table, which is like 7 properties.
Here is the raw sql query that ActiveRecord generates (this is the result of all 3 ways as I've done above):
SELECT `properties`.* FROM `properties` WHERE (lat >= 47.609093368933195)
#<Property:0x007fa333ac1880>
#<Property:0x007fa333ac1718>
#<Property:0x007fa333ac15b0>
As for the schema, it's just one table that I'm using and no joins.

What is the relationship between CGPDFContext and CGPDFDocument?

My understanding of this was that perhaps CGPDFContext is to be used for editing PDF document data and CGPDFDocument is used for storing it, since the documentation doesn't list any ways to alter the content of a CGPDFDocument.
I'm also not quite sure what CGDataConsumer/Provider does. From reading the documentation I got the impression that the consumer/provider abstracts the relationship between the CG object and the CFData it writes to; so I don't have to do that myself. So I figured the following code would create a two page blank PDFdocument:
//Don't know exactly how large a PDF is so I gave it 1 MB for now
self->pdfData = CFDataCreateMutable(kCFAllocatorDefault, 1024);
self->consumerRef = CGDataConsumerCreateWithCFData(self->pdfData);
self.pdfRef = CGPDFContextCreate(self->consumerRef, NULL, NULL);
CGPDFContextBeginPage(self.pdfRef, NULL); //Creates a blank page?
CGPDFContextEndPage(self.pdfRef);
CGPDFContextBeginPage(self.pdfRef, NULL); //Creates a second blank page?
CGPDFContextEndPage(self.pdfRef);
//Copies the data from pdfRef's consumer into docRef's provider?
self.docRef = CGPDFDocumentCreateWithProvider(
CGDataProviderCreateWithCFData(
CFDataCreateCopy(kCFAllocatorDefault, self->pdfData)
));
It didn't work though, and NSLogging the first two pages of docRef returns NULL. I'm rather new at this, the C-Layer stuff in particular. Can someone explain to me the relationship between CGPDFContext, CGPDFDocument, CGDataConsumer & CGDataProvider and how I'd use them to create a blank PDF?
Your basic understanding is correct as far as I can see:
A CGPDFContext is a drawing context that "translates" everything that is drawn onto it to PDF instructions (typically for storage in a PDF file).
A CGPDFDocument is used to open an existing PDF file and get information from it.
When you want to create your own PDF file, you have two ways to do it as described here: https://developer.apple.com/library/mac/documentation/graphicsimaging/reference/CGPDFContext/Reference/reference.html
Use "CGPDFContextCreate" which you pass a data consumer. The data consumer gets the data and can do with it as it pleases (you could create a data consumer that passes the PDF onto the clipboard for example).
Use "CGPDFContextCreateWithURL" which you pass a URL. In that case your data will be written to a PDF file at that URL.
If you want to use these functions, have a look at this page https://developer.apple.com/library/mac/documentation/graphicsimaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html#//apple_ref/doc/uid/TP30001066-CH214-TPXREF101 which explains in detail how to create PDF files with a data provider and without (simply to a PDF).
To figure out what is happening I would start by trying to write a simple PDF file to disk before writing one to a data provider and then using that data provider immediately to read it again. Without trying your code however, let me point out that you didn't use "CGPDFContextClose" which is described in the document as closing the PDF document and flushing all information to output. You could actually having a situation where stuff is cached and not written to your data provider yet, simply because you haven't forced that.

How to add components in to an existing GUI created by guide?

I just created a GUI using guide in MATLAB for a small project I'm working on. I have amongst other things two text fields for from and to dates. Now I'd like to get rid of them and use a Java date select tool. Of course this is not possible using guide so I need to add them manually.
I've managed to get them to show up by putting this code into my Opening_Fcn,
uicomponent(handles, 'style','com.jidesoft.combobox.DateChooserPanel','tag','til2');
using UICOMPONENT.
But even though it shows up I can't access the date select's attributes, for example
get(handles.til2)
returns
??? Reference to non-existent field 'til2'.
How can I fix this?
Unless you edit the saved GUI figure, the basic handles structure will not include your new component by default.
One way to access you component is to store the handle via guidata, by adding the following to your opening function:
handles.til2 = uicomponent(handles, 'style','com.jidesoft.combobox.DateChooserPanel','tag','til2');
guidata(hObject,handles)
Functions that need to access the handle need the line
handles = guidata(hObject)
to return the full handles structure that includes the filed til2

Resources