Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Three questions -- Morris Chart, Host Settings, Automatic #395


User avatar
0
Hasan created

Hello Team

There are three questions here..

  1. In the commercial project, do we have a sample of Morris Chart data comes from controller ?. If you do not have, is it possible to put up some example ?

  2. I am unable see the Tenent Settings for the default admin user ?. How to get it enabled ? What is difference between Tenent, Host and Common folder and why we need to put Views in the Tenent Folder ?

  3. How to enable the auto migration for Entity Framework ?. If not, whenever I deploy to my customer server (Azure Website or Cloud) how can I run the migration automatically ?

Thanks


4 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi Hasan,

    Are you using SPA (angular) or MPA? I assume it's SPA.

    1. There is no exact sample for your case. But there is a Morris Chart which has client-generated fake data (<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/App/tenant/views/dashboard/index.js#L37">https://github.com/aspnetzero/aspnet-ze ... dex.js#L37</a>) and there is a sparkline graph which gets data from server (<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/App/tenant/views/dashboard/index.js#L11">https://github.com/aspnetzero/aspnet-ze ... dex.js#L11</a>). So, you will just get data from server similar to 2nd example, no difference.

    2. Maybe you're disabled it in the roles or per user. It should be visible to admin by default. Is your product multi-tenant? Folders are seperated to easier managing. If you are creating a tenant page, just put under tenant folder, that's all. If you're developing single-tenant app, just put all under the tenant, no matters in this case.

    3. I've no sample yet, but there is no difference, you can find samples from web for EF automatic migrations. Also, search the forum, there should be some others deployed to Azure without problem. I've no much azure experience.

    Have a nice day.

  • User Avatar
    0
    Hasan created

    Hello Hikalan,

    Thanks for the answer

    Is it possible to give a Morris Chart Example ?

    I have tried like below but it is not getting refreshed

    Morris.Donut({
                element: 'payment_stats',
                data: [
                  { label: "Download Sales", value: 12 },
                  { label: "In-Store Sales", value: 30 },
                  { label: "Mail-Order Sales", value: 20 }
                ]
            });
    
            Morris.Donut({
                element: 'transaction_stats',
                data: _ticketService.getTransactionStats()
            });
    

    The first Morris is coming into the Screen but the second one is not coming. My Service is this like below

    public MorrisOutputDto GetTransactionStats()
            {
                
                List<MorrisListDto> outputDtos = new List<MorrisListDto>();
    
                outputDtos.Add(new MorrisListDto()
                {
                    Label = "SALES",
                    Value = 190
                });
                outputDtos.Add(new MorrisListDto()
                {
                    Label = "PURCHASE",
                    Value = 190
                });
                outputDtos.Add(new MorrisListDto()
                {
                    Label = "NETS",
                    Value = 190
                });
                MorrisOutputDto outputDto = new MorrisOutputDto(outputDtos);
    
                return outputDto;
            }
    

    Please correct me where i am wrong

    Thanks mate

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    I have no full-stack working morris chart example. But it's a 3rd party library and I believe you can find your questions in it's documentations. I don't know how you're trying to refresh it but there may be a method, I did not try. I prefer to not go details of 3rd part libs since there are hundreds of libraries in Metronic and they all have good documentation (and probably supports).

    Thanks.

  • User Avatar
    0
    Hasan created

    Hello Sir

    I have done that perfectly. Here is the code for that

    function payment_chart() {
                abp.ajax({
                    url: '/Dashboard/paymentChart'
                }).done(function (data) {
                    Morris.Donut({
                        element: 'payment_stats',
                        data: $.parseJSON(JSON.stringify(data)),
                        resize: true
                    });
                });
                return JSON.stringify("");
            }
    
            payment_chart();