Chart screenshot does not show labels


#1

I am following the code of blog entry http://www.shinobicontrols.com/blog/posts/2012/03/26/taking-a-shinobichart-screenshot-from-your-app/ to take screenshots of charts.

This works in general. (Except the provided category SChartGLView+Screenshot.h still not contains [EAGLContext setCurrentContext:_context])

But if I take a screenshot of a pie chart like the PieChart demo provided, the labels are not visible using ShinobiCharts version 2.2.1.

Pie without labels

Is there a bugfix or workaround to solve this problem? Thank you!


#2

Hi Uscher,

This is a feature we are currently implementing as we are planning to update the Screenshot blog soon.

Kind Regards,
Andrew Polkinghorn


#3

Hi,

Some news about this? I didn’t found anything changed on the blog. The pie char snapshot in hardly readable in the actual way.

Regards.


#4

Hi Skizzato,

We have the updated snapshot code available in our “charts-snippets” github repository, located in the “iOS/objective-c/screenshot” directory which can be found HERE.

Kind Regards,
Andrew Polkinghorn


#5

Thank you for the improvements in screenshot code.  :slight_smile:

There are still some issues I ran into:

  1. Annotation code has to be commented in ECShinobiCharts+Screenshot.h if shinobi premium feature is not purchased.

  2. If labels are changed interactively, the current labels have to be removed. Therefore a clear function is required. I added following:

    -(void)clearPieChartLabels {
    objc_setAssociatedObject(self, OBJECT_KEY, nil, OBJC_ASSOCIATION_RETAIN);
    } 3) In screenshot the lines are overdrawn by the donut (see picture). On the screen it’s fine. What is the fix for this?

    Best regards,Uscher


#6

Hi Uscher,

Thanks for your feedback!

I have passed these issues onto our development team where they will be investigated further. This forum post will be updated when solutions to your issues have been resolved.

Let me know if you have any other queries regarding the snapshot code.

Kind Regards,
Andrew Polkinghorn


#7

Hi Uscher,

The latest version of our Snapshot code allows you add UIViews infront of your rendered data.

This can be found in our Github repository HERE.

Let me know if you have any issues. 

Kind Regards,
Andrew Polkinghorn


#8

Thank you Mark for the improvements. :smile: It does not automatically fix the overdrawn lines problem (3). It’s quite tricky to add all views to snaphot correctly…

Another issue is that the sharpness of the bitmaps is of less quality than of screenshots taken of the whole screen using the buttons.

However, the iOS7 screenshot API presented in the blog seems to be a better approach - but turns out to be also tricky… If you one day could provide a iOS7 screenshot sample with shinobi charts, this would be highly appreciated.  :wink:

Best regards,
Urs


#9

Hi Uscher,

Regarding the overdrawn line problem, if you add the “LineView” variable in the sample to the snapshot using the “addViewToSnapshot:addToGlView:” this should fix your issue.

What are you finding tricky about taking a snapshot of a ShinobiChart using iOS7’s snapshot approach?

Thanks for the iOS7 snapshot blog post suggestion, I have forwarded your request to our development team. Someone will update this forum post when your request has been reviewed. 

Kind Regards,
Andrew Polkinghorn


#10

Thank you Andrew. Yes, I played around with add and clear the LineView to the snapshot. But the timing for doing that is the problem… I gave up this cosmentics now and do not investigate more.

Well, the iOS7 blog is a big general story. If it is so easy, it could be kept short with a simple shinobi example.

Best regards,
Urs