Coder Social home page Coder Social logo

Comments (8)

entronad avatar entronad commented on May 14, 2024 1

After thinking thoroughly, dimensions now has a enum type Dim instead of int [1, 2], which is always confused with [0, 1], in the new v0.7.0

from graphic.

entronad avatar entronad commented on May 14, 2024

Grid lines depend on ticks. How to calculate where there are ticks is called "nice number calculattion".
The current automatic nice number calculation seems not intelligent enough, we are working on it.

The temporary solution is to indicate the tick count mannually (I guess you want the first grid to align to the starting radius, so added align: 0):

'index': Variable(
  accessor: (Map map) => map['index'].toString(),
  scale: OrdinalScale(tickCount: 13, align: 0),
),

from graphic.

Kashorako avatar Kashorako commented on May 14, 2024

Grid lines depend on ticks. How to calculate where there are ticks is called "nice number calculattion". The current automatic nice number calculation seems not intelligent enough, we are working on it.

The temporary solution is to indicate the tick count mannually (I guess you want the first grid to align to the starting radius, so added align: 0):

'index': Variable(
  accessor: (Map map) => map['index'].toString(),
  scale: OrdinalScale(tickCount: 13, align: 0),
),

Hello my friend, thank you for your answer, effectively the points appeared after changing the ticks as you suggested, but now we have problems related to the touch.

For example in the next image if i touch the red arrow, the tooltip for the blue arrow is being displayed, this problem happens in most of the points.

bug_graphic_flutter

You can also see the reproduction of the error in the next video:

WhatsApp.Video.2021-12-21.at.3.05.28.PM.mp4

Thank you for your help!

from graphic.

entronad avatar entronad commented on May 14, 2024

Please provide your specifications, especially the variables, selections and tooltip.

Your selection involves different groups and multiple variables, a little bit complex, so it may need some special indications.

from graphic.

Kashorako avatar Kashorako commented on May 14, 2024

Hello @entronad , as you requested, we are sending the chart and variables:

child: Chart(
                                data: mapRatios,
                                variables: {
                                  'initials': Variable(
                                    accessor: (Map map) =>
                                        map['initials'].toString(),
                                    scale:
                                        OrdinalScale(tickCount: 13, align: 0),
                                  ),
                                  'name': Variable(
                                    accessor: (Map map) =>
                                        map['name'].toString(),
                                  ),
                                  'year': Variable(
                                    accessor: (Map map) =>
                                        map['year'].toString(),
                                  ),
                                  'value': Variable(
                                    accessor: (Map map) => map['value'] as num,
                                    scale: LinearScale(min: (valmin - 5)),
                                  ),
                                },
                                elements: [
                                  LineElement(
                                    position: Varset('initials') *
                                        Varset('value') /
                                        Varset('year'),
                                    shape: ShapeAttr(
                                      value: BasicLineShape(
                                        loop: true,
                                      ),
                                    ),
                                    color: ColorAttr(
                                      variable: 'year',
                                      values: Defaults.colors10,
                                    ), 
                                  ),
                                ],
                                coord: PolarCoord(),
                                axes: [
                                  AxisGuide(
                                    flip: true,
                                    position: 1,
                                    line: StrokeStyle(
                                      color: const Color(0xffe8e8e8),
                                    ),
                                    label: LabelStyle(
                                      const TextStyle(
                                        fontSize: 11,
                                        color: Color(0xff808080),
                                        fontWeight: FontWeight.w500,
                                      ),
                                      offset: const Offset(-5, -15),
                                    ),
                                    variable: 'initials',
                                    grid: StrokeStyle(
                                      color: const Color(0xffe8e8e8),
                                    ),
                                  ),
                                  // Defaults.circularAxis,
                                  Defaults.radialAxis,
                                ],
                                selections: {
                                  'touchMove': PointSelection(
                                    on: {
                                      GestureType.scaleUpdate,
                                      GestureType.tapDown,
                                      GestureType.longPressMoveUpdate
                                    },
                                    dim: 0,
                                    variable: 'initials',
                                  )
                                },
                                tooltip: TooltipGuide( 
                                  align: Alignment.bottomRight,
                                  multiTuples: true,
                                  variables: ['year', 'value'],
                                ), 
                              ),

Thank you so much

from graphic.

entronad avatar entronad commented on May 14, 2024

The problem is dim: 0 should be dim: 1. The dim in the plane is 1 and 2, not 0 and 1.
I am also doubt which one to describe the dim is better, [1, 2] or [0, 1]?

from graphic.

Kashorako avatar Kashorako commented on May 14, 2024

@entronad Thank you so much for your quick answers, it's now working

Bleesings, happy new year!

from graphic.

entronad avatar entronad commented on May 14, 2024

The tick nice number algorithm is optimized in 0.8.0, now tickCount can be saved in this case.

from graphic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.