Giter VIP home page Giter VIP logo

Comments (5)

r-mzy47 avatar r-mzy47 commented on July 17, 2024

Hi. Yes, zooming on the chart using mouse scroll is intended. Do you have any problem with this?
Could you please provide some code snippets so I can help you with that?

from candlesticks.

The-Mr-L avatar The-Mr-L commented on July 17, 2024

well it is just using the example of yours and it is the same result in the live demo. zooming works but it is reversed behavior to everything else zooming related mouse wheal up should zoom in etc :) and I cant seam to figure out a way to make the chart render on new data I mean new dataset like a a new stock etc

from candlesticks.

r-mzy47 avatar r-mzy47 commented on July 17, 2024

Try changing the key when you want to reset the chart. The unique key doesn't work because it passes the same key on every build. try building your key from your data. like: key: Key(SYMBOL + TIMEFRAME) so your chart resets every time TIMEFRAME or SYMBOL changes.

from candlesticks.

The-Mr-L avatar The-Mr-L commented on July 17, 2024

Yes that is what I have tried
I am using Getx and I have made sure that the key is valid

uic is unique int id


class CandleChart extends GetView<MyController> {
  final List<Indicator> indicators = [
    BollingerBandsIndicator(
      length: 20,
      stdDev: 2,
      upperColor: const Color(0xFF2962FF),
      basisColor: const Color(0xFFFF6D00),
      lowerColor: const Color(0xFF2962FF),
    ),
    WeightedMovingAverageIndicator(
      length: 100,
      color: Colors.green.shade600,
    ),
  ];

  @override
  Widget build(BuildContext context) {
    return Obx(() =>
    Expanded(
      child: Row(
        children: [
           Text(controller.chart.value.uic.toString()),
          Candlesticks(
           key:Key(controller.chart.value.uic.toString()),
           candles: controller.getCandles4Chart(),
                  indicators: indicators,
                ),
        ],
      ),
    ),
    );
  }
}

and in my controller

List<candlesticks.Candle> getCandles4Chart() {
    return chart.value.daily.candles
        .map((c) => candlesticks.Candle(
            date: DateTime.fromMillisecondsSinceEpoch(
                (c.time.seconds * 1000).toInt()),
            high: c.high,
            low: c.low,
            open: c.open,
            close: c.close,
            volume: c.volume))
        .toList()
        .reversed
        .toList()
        ;
  }

this just results in the progress circle

from candlesticks.

r-mzy47 avatar r-mzy47 commented on July 17, 2024

Are you sure that the candles List is not empty?

from candlesticks.

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.