Skip to content

Allow stacking data sets in Line Chart #41

Description

@KarthikRIyer

A stack plot is similar to a Line Plot, the difference being that the data sets are stacked over one another. A simple example can be found here.

This task will require you to implement the following:

  • Add functions to atleast two from the three renderers (AGG/SVG/CoreGraphics) to allow drawing of solid polygons.
  • Add the capability to allow stacking of data sets in Line Chart.

Activity

  1. boronhub commented on Dec 10, 2019

    @boronhub
    Contributor

    Hi, I'm interested in working on this.

  2. KarthikRIyer commented on Dec 10, 2019

    @KarthikRIyer
    OwnerAuthor

    @boronhub that's great! You should claim the task on the GCI website and also state there that you're interested in working on this issue. If you have any other questions, feel free to ask.

  3. boronhub commented on Dec 10, 2019

    @boronhub
    Contributor

    One of my other tasks still hasn't been reviewed, so I can't claim it yet. Can I still start work on this so as to familiarize myself with SwiftPlot ?

  4. KarthikRIyer commented on Dec 10, 2019

    @KarthikRIyer
    OwnerAuthor

    @boronhub sure!

  5. boronhub commented on Dec 10, 2019

    @boronhub
    Contributor

    Is there a Google Group or an IRC where we can discuss this ?

  6. KarthikRIyer commented on Dec 10, 2019

    @KarthikRIyer
    OwnerAuthor

    There is a Google Group for Swift for TensorFlow, but I prefer we discuss it here in GitHub issues.

  7. boronhub commented on Dec 10, 2019

    @boronhub
    Contributor

    The changes have to be made in LineChart.swift, right ?

  8. KarthikRIyer commented on Dec 10, 2019

    @KarthikRIyer
    OwnerAuthor

    @boronhub yes. You need to make changes in LineChart.swift.
    You can create a file LineChartSeriesOptions.swift similar to HistogramSeriesOptions.swift. Using that you can decide if you want the plot to be stacked or not.

  9. KarthikRIyer commented on Dec 10, 2019

    @KarthikRIyer
    OwnerAuthor

    @karwa do you have any suggestions regarding this?

  10. karwa commented on Dec 10, 2019

    @karwa
    Contributor

    Not particularly - just to follow the example set by BarGraph when it comes to stacking.

    Matplotlib calls this a stackplot and has this as a separate kind of chart. I think that would probably also make sense for us, rather than combining it with the line chart (for example, you can't have multiple series on a line chart if the some of the series also have stacks and are filled underneath).

  11. KarthikRIyer commented on Dec 10, 2019

    @KarthikRIyer
    OwnerAuthor

    I agree. @boronhub you could make a new chart type. I think you should be able to lift most of the code from line chart and make the required changes to get it working.

  12. boronhub commented on Dec 11, 2019

    @boronhub
    Contributor

    The example notebook isn't working in Jupyter.
    It's saying Line magic command '%install' not found.

  13. KarthikRIyer commented on Dec 11, 2019

    @KarthikRIyer
    OwnerAuthor

    @boronhub the example notebook isn't updated. Are you using swift-jupyter, or colab?

  14. boronhub commented on Dec 11, 2019

    @boronhub
    Contributor

    colab

  15. KarthikRIyer commented on Dec 11, 2019

    @KarthikRIyer
    OwnerAuthor

    Plotting on colab won't work at the moment. There's some problem in that. But you can use swift-jupyter. The notebook example hasn't been updated. You can copy the code from the example in the docs.

  16. WilliamHYZhang commented on Dec 15, 2019

    @WilliamHYZhang
    Contributor

    @boronhub are you still working on this? I got swiftplot on Linux working if using the notebook is giving you difficulty.

  17. boronhub commented on Dec 15, 2019

    @boronhub
    Contributor

    My VM keeps crashing so im trying to build swift on Windows. I got the notebook working, but %install still isn't working.

  18. KarthikRIyer commented on Dec 15, 2019

    @KarthikRIyer
    OwnerAuthor

    @boronhub you can try using the Linux Subsystem for Windows. So you won't need a VM to use Linux. Check this out: https://docs.microsoft.com/en-us/windows/wsl/install-win10

    But you won't be able to use swift-jupyter or any GUI based applications, but you'll be able to work on SwiftPlot and won't need to build swift.

  19. boronhub commented on Dec 15, 2019

    @boronhub
    Contributor

    Yeah , I tried WSL as well but to no avail.

  20. boronhub commented on Dec 15, 2019

    @boronhub
    Contributor

    I'll figure it out soon

  21. WilliamHYZhang commented on Dec 15, 2019

    @WilliamHYZhang
    Contributor

    Alright, best of luck!

  22. boronhub commented on Dec 17, 2019

    @boronhub
    Contributor

    error: could not build C module 'CoreFoundation'

    can't seem to get over this, any suggestions ?

  23. KarthikRIyer commented on Dec 17, 2019

    @KarthikRIyer
    OwnerAuthor

    @boronhub where are you getting this error? Could you provide more details?

  24. boronhub commented on Dec 17, 2019

    @boronhub
    Contributor

    upon executing

    %install-swiftpm-flags -Xcc -isystem/usr/include/freetype2 -Xswiftc -lfreetype
    %install '.package(url: "https://github.com/IBM-Swift/BlueCryptor.git", from: "1.0.28")' Cryptor
    %install '.package(url: "https://github.com/KarthikRIyer/swiftplot", .branch("master"))' SwiftPlot AGGRenderer

    in a jupyter notebook (used WSL)

  25. KarthikRIyer commented on Dec 17, 2019

    @KarthikRIyer
    OwnerAuthor

    @boronhub I haven't seen this error before and am having trouble using jupyter notebook in WSL. But you do not need jupyter to work on swiftplot. You can still use the command line.

  26. boronhub commented on Dec 17, 2019

    @boronhub
    Contributor

    Is there any documentation for this?

  27. WilliamHYZhang commented on Dec 17, 2019

    @WilliamHYZhang
    Contributor

    Try installing swift on ubuntu linux here: https://itsfoss.com/use-swift-linux (use the most recent swift version files)

  28. anigasan commented on Dec 20, 2019

    @anigasan
    Contributor

    @boronhub - Looks like you are opening in python notebook, %install etc. will not work in Jupyter. I tried installing packages through Anaconda and Python and was not successful.

    Alternatively, you can use the route mentioned by @WilliamHYZhang ...It is working!

    Also, I tried using Docker image https://github.com/apple/swift-docker. It works as well, but requires some minor tweaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions