Sie sind auf Seite 1von 228

CHATBOT SYSTEM DESIGN

Designing of a chatb ot live system

Windows User

0
Chatbot designing

Table of Contents
Chapter 1: Introduction .......................................................................................................... 2

Chatbot: A definition.......................................................................................................... 2

A brief history of Chabot ....................................................................................................... 3

MSN Messenger ................................................................................................................. 3

Chapter 2: Theoretical background........................................................................................ 7

2.1 Introduction ................................................................................................................ 7

2.2.2 Recurrent Neural Networks .......................................................................... 9

2.5 Knowledge management ..................................................................................... 12

Basic Concept of Chatbot .............................................................................................. 12

Requirements ....................................................................................................................... 14

Chapter 3.Design/architecture ............................................................................................. 16

Limitations for Chatbot ................................................................................................. 19

Features of chatbot ......................................................................................................... 21

Impact of chatbot on various companies ..................................................................... 23

Malicious Utility of Chatbot .......................................................................................... 23

Literature Gap ................................................................................................................ 25

Chapter 4: Objectives and milestone ................................................................................... 26

Identified user problems ................................................................................................ 26

Chapter 5: Software Architecture ........................................................................................ 26

5.1 Agent environment .............................................................................................. 26

5.2 Class diagram ...................................................................................................... 27

Chapter 6: Software implementation ................................................................................... 28

Chapter 7: Experiments and results ..................................................................................... 30

Future scope ......................................................................................................................... 31

Chapter 8: Conclusion ......................................................................................................... 33

1
Chatbot designing

Chapter 1: Introduction

Chatbot: A definition

A chat is being designed with reference of the Oxford dictionary as

Chatbot (n):

It is the programming language that has been design to dynamize the conversation between
the human users through the internet.

By analysing the scientific literature, Chabot is formally introduced as a an interaction


between the agents through the internet .In this above case study the term Chabot or the
conversational agent will be implemented vice versa.

The fundamental concept of every Chabot is the conversation or the collaraboratin


between the human users through text messages and there should be a a capability of
understanding the language and replying it to the user as soon as possible. The
conversation or the interaction between the human and computer is as old as in the
computer science sector. In fact Alan turning has implemented a simple test which is
named as “Turning back test ” where interaction between the human is done through text
messages is analysed and a judge should be made whether it is a computer program or
not. Moreover the Test’s enthusiasm is much more higher than the regular use case of
Chabot. The main contrast is that have been analysed is the domain knowledge of the chat
bot is limited whereas the results of the test relate that conversation between the human
users state that human users can talk on any topic. The model which has been implemented
state that the user doesn’t need to interact on specific topic as there are no limitations of
knowledge. More over another hypothesis that have been analysed that have been analysed
is every interaction between the human user should have a objective and the objective
should be achieved by the end of the conversation between the human resources. Thus it
also enhance the conversation’s flow as well as he topic to meet its motive or objectives
(Ciechanowski,2019).

2
Chatbot designing

Therefore the definition of Chabot that has been analysed is that Chabot is a programing
language which is used for interaction between the human users as well as it provides
service to the human in order to achieve their goals or motive

A brief history of Chabot


Chabot was first introduced in 1996. A computer programming named ELIZA which was
uses or implemented and affect the psychiatrist and recast the user using natural language
with implementation of processing technique. Successfully the program managed to solve
all the confusion that have been analysed and fooled many people. Joseph Weizenbaum
who has invented the program said that his secretary who ask him for a leave of absence so
that he can chat with ELIZA.

ElIza’s approach has been followed for several years with minimum innovation and
addition of new features into the program such as emotion management. Later Smarter
child was invented in 2001 and developed by Active Buddy Inc which was operated on
AOl messenger.

MSN Messenger
As motivated by the rise of the increasing messaging sector like SMS, Smart Child was
also invented to provide the quick access to the weather report and as well as the news of
sports . Later Smart Child had implemented methods and increase in innovation as smart
Child is connected to a knowledge base which gives a useful information to the users so
that it is helpful for the users during the interactions. Unfortunately many technical
limitations were analysed in the processing language and later smart Child was erased
from the history.

As there is an increase in the development of techniques in the modern world a new


software was developed by IBM team through WAI project which is the development
since 2006. The software was made with the main motive is to win the American TV show
that is Jeopardy which was later achieved in 2011 by competing with two other Television
shows. Jeopardy is an interesting TV show which from the NPL point of view as the
questions that are allocated requires vast amount of knowledge and play of words.
Unfortunately this could answer only one question which is difficult to carry out proper
conversation between the human users. Moreover the it will take more time to interact
between the human users.

3
Chatbot designing

Later with the advancement of new technologies and innovation many other software ere
developed such Apple siri, Google Assistant, Amazon’s Alexi and others which help the
human users to interact between them in a shorter time. The employees or the agents that
were brought in the sector of conversation were globally oriented. Later Facebook
messenger was introduced and later became famous and allowed the creational of
conversational agents for non Ai related companies.

As explained in the brief summary regarding to the concept of the conversational agent
ther has been a huge progress in the field of Neuro Linguistic programming language
however the advancement of the techniques were implemented and the current solution are
without errors which has been highlighted in the next section.

Motivation

Several structure and models have been implemented as well as it have been analysed for
the concern of customer satisfaction. The recent which has been conducted by the drift
with collaboration Survey Monkey which can analyse the images of the chat bot provide
them in front of the customers. This include following observations

The primary issues is the customer faces problems with the traditional online
conversation channels .thirty four per cent of the customers state that the online website are
difficult to read as well as it is difficult to navigate and thirty one per cent of the customers
state that it is difficult to find simple question answer through the communication sector.

There are many potential benefits that the customer observes in the Chabot service as there
is twenty four hour service and with sixty four per cent of instant replies which increases in
resolving the issues that is faced by the customers.

The recent study it has been clear that customers are facing problems and need of the
customers as well as the expectations of the customers re not fulfilled by the traditional
channel. They also analyse the perks of the chat board in comparison to other solutions.

In the recent survey that is conducted by the Chatbot.org shows that the current Chabot is
less effective as observed. After complete analysis from all the generations the fifty three
per cent of the customers view the Chabot as less effective or average effective. It also
highlights the distinction between the potential advantage of the methods and
implementation of the methods in order to attain desire objective and goals. Dividing the
customer review and expectation it is have stated that the younger generation are more

4
Chatbot designing

optimistic with the conversational agents. According to the survey the silent generation
stated the Chabot to be less effective whereas the generation z stated the Chabot to be more
effective thus ratting the Chabot fifty four per cent.

Word embedding

The fundamental of mapping up of the words into various vectors is called word
embedding. The vector information is directly transformed in to machine language which
has algorithm as featured. There are different ways of amplifications of the operation as
ranging from simple word count and have different methods of learning approach. The
later part of the model is proven to work efficiently which will help the customers to work
efficiently. In the above diagram the skip-gram model has been explained broadly since the
techniques used in the model have been to help to implement the methods to enhance the
process.

Skip Gram Model

The basic principle of skip gram model is the sliding window with a fixed size which runs
across the word sequence as it targets the word and the proceedings of the word one after
each other from the context of the word. The main objective of the model is to implement
the inner layer and use the representations of the vector for the trained vocabulary. In the
above practice the corpus is changed into sequence of the words. More over the input
words are coded single which shows a look up table of vector representation. The skip
gram model is being created because sequence of indices are changed and analysed into
vector to get the results of final algorithm.

Recurrent Neural network

Recurrent Neural network is a another type of network which specifically analysed the
sequence of the data. Nutshell contains neural networks with loops. Moreover they contain
internal functions and symbols such (,0 0 for the state at time. The neuron also values the
output such as value, at each step which is being implemented. The main problem that is
being faced by the RNN while implementing as they suffer with the dissolve and
exploding problems . Many variables of the RNN have been introduced in order to mitigate
the problems of various issues that have faced by operations. The most common problem
that has been faced is listed below.

5
Chatbot designing

Long short term memory unit

Long short term is a natural processing unit which is invented at 1997 which is becoming
popular in recent years and and it has been improved with the development and
advancement of new technologies and advancement of hardware accelerate deep learning.
They also showed the desired results in machine translation and image captioning.

Language identification

Language Identification is something which tells us about the natural processing unit
.Moreover the language processing is needed for the larger conversation of natural
processing. Many languages contain homographs which contains different languages such
as English as well as Dutch and there is difference in the meaning of both languages which
may confuse with the semantics of the particular word hence identifying of the language is
needed form the above text. We distribute two models for language identification, which
can recognize 176 languages (see the list of ISO codes below). These models were trained
on data from SETimes, used under CC-BY-SA.
We distribute two versions of the models:

 lid.176.bin, which is faster and slightly more accurate, but has a file size of 126MB ;
 lid.176.ftz, which is the compressed version of the model, with a file size of 917kB.
These models were trained on UTF-8 data, and therefore expect UTF-8 as input.

Intent Classification

When a new message has been received the cconverstional tries to understand the main
objective of the user that he wants to attend. This is also known as multiclassification
problems which is used to detect the intention of the user. several methods that are used to
solve the problem vary from word to word and moreover the it also helps to understand the
intention of the user by analysing multiple messages.

Knowledge management

Any intelligent conversational agent has immense amount of knowledge on the


conversational data. This field is related to computers handling knowledge that have
extracted by the user. New technologies have been implemented in order to extract new
ideas as well as the first and second order knowledge. This is a knowledge management
site covering the theories, frameworks, models, tools, and supporting disciplines that are

6
Chatbot designing

relevant to both the student and the practitioner. The goal of this site is to provide a
comprehensive overview of knowledge management by examining its objectives, scope,
strategy, best practices, knowledge management tools, and so on. The site is structured
very much like a textbook, with introductory concepts at the top, more subject-specific
discussions in the latter half.

Chapter 2: Theoretical background

In this chapter we will discuss about the theoretical background of the process and
implementation of this chat bot system. This chapter consists the theoretical overview with
respect to the modern approach of development of a conversational application.

2.1 Introduction

The second chapter of this research study focuses on the part of literature review that
has been fundamental in highlighting the variables that are useful in constructing the research
study in relation to the research topic of Chatbot. The literature review reflects on the
authenticity of the research problem through the information that is available in the literature
review of this research study. The primary purpose of this literature review in this research
study is to grant foundation of authentic information and data on the given research subject.
The literature review sheds light on the various attributes of the research topic that includes
the basic concept of Chatbot. The literature review also states the authentic information with
regard to the various evolving features of a Chatbot and its alignment with artificial
intelligence. This chapter has also formulated various information regarding the useful
application of a Chatbot in enhancing the utility and speed of communication technology
applicable in various companies (Kolbe,2018). The chapter further enlightens the researcher
on the malicious utility of Chatbot along with limitations of Chatbot. The chapter has
included a proper literature gap along with a significant conceptual framework to shape the
various information provided in this chapter of literature review.

7
Chatbot designing

Figure: - schematic of a chatbot

(Source: - created by user)

Skip-gram model

Skip diagram model is one of the important part in designing the text system. As for
any kind of the text application it is very necessary to convert the present text format to the
other format. The reason behind doing this process is that the designed application have to
run on different platforms and for running on different platform, the newly designed
application should be able to read the various text format. In case if the application is un able
to ready the available text then the application must have the feature of converting those
exits into the system build format and hen the application have to process the further tasks.
For this reason it is very important implement this skip diagram model in the chatbot
development process.

8
Chatbot designing

Eventually, training examples of the form (wt,[wt−2,wt−1,wt+1,wt+2]) if the window size


is 5, are generated. The definition of context varies between authors but the basic principle
remains the same: a sliding window of fixed size is

wt − 2

wt − 1

wt w

wt +1

wt +2

Figure: Skip-gram model in the case of a 5 words window.

2.2 Recurrent Neural Networks

Figure 2.3: LSTM layer.

9
Chatbot designing

ft = σ(Wf · [ht−1,xt] + bf) (2.1)


it = σ(Wi · [ht−1,xt] + bi) (2.2)
Ct = ftCt−1 + it tanh(WC · [ht−1,xt] + bC) (2.3)
ot = σ(Wo · [ht−1,xt] + bo) (2.4)
ht = ot tanh(Ct) (2.5)
Equation 2.1 is the forget gate’s output it represents the identity of information the
unit will hold or forget from the previous cell state Ct−1 as it is directly multiplied with it.
Figure 2.4 illustrates this process.

Figure 2.4: LSTM unit’s forget gate.

Source: Olah,

The input gate’s response is given by equation 2.2. It simply creates a new candidate
value for the cell state, denoted C˜t, scaled by it as shown on Figure.

Figure 2.5: LSTM unit’s input gate.

Source: Olah, Understanding LSTM Networks

The cell state is then connected to the initial point of the first output and then the
next cell is stated forward for the attachment to the next level.

10
Chatbot designing

Figure: LSTM unit’s cell state update.

Source: Olah, Understanding LSTM Networks

when the cell state is updated, the output gate’s activation can be calculated using
equation 2.4 to generate the unit’s hidden state ht. the above given figure describes the whole
statement significantly.

2.7. Gated Recurrent Units

Figure: LSTM unit’s output gate.

Source: Olah, Understanding LSTM Networks

For the sake of completeness, the equations for GRUs are given below :

zt = σ(Wz · [ht−1,xt] + bz) (2.6) rt = σ(Wr · [ht−1,xt] + br) (2.7) h˜t


= tanh(W · [rtht−1,xt]) (2.8) ht = (1 − zt)ht−1 + zth˜t (2.9)

where zt and rt correspond to the GRU’s inner gates as shown in the diagram in Figure 2.8.

Both the LSTM and GRU were considered for developing the chatbot. Their use will
be examined further.

11
Chatbot designing

2.3 Knowledge management

NOUN NOUN ( NOUN )

CITY

PERSON direct MOVIE

Figure: A toy retrieval-based example where the user query matched a simple rule, in
green, which triggers the corresponding answer

Generative-based techniques on the other hand rely on generative models to produce


new replies without the need for an extensive database of examples. Novel responses can
be generated easily provided the model is trained correctly. However as of today,
generative-based approaches’ performance is insufficient relative to companies’
constraints. and the industry is still not convinced of its potential, as shown by the
unfortunate tale of Microsoft Tay [17].

Figure: A toy generative-based response generation example.

Basic Concept of Chatbot

The system of Chatbot has been modified through the inclusion of higher artificial
intelligence (AI) software. This highly efficient and dextrous software has been made in
order to emphasize the mode of communication and simplify the way in which
communication can be established through higher effective technology. This software of
Chatbot has been designed in order to simulate and amplify the conversation with another
user on the other end through the medium of natural language. This is done through a normal
messaging application, like several messaging applications that already exist. This software
can be used through websites, or even through the telephone in which a human like voiced

12
Chatbot designing

will be functional in simulating the message that the user wants to know or needs to get hold
of. The Chatbot can help the user with various queries like finding their required files or
important contacts. The Chatbot has been made to function in a way that can be utilized to
gather and store significant data about the user but these data are stored after taking prior
permission from the individual users who use these higher artificial intelligence software
(Fawcett,2019).

The Chatbots are often used in the area of customer service by serving the needs and
queries of the customers. They are provided with the simulation that they are being helped
and served by a real human and this has the ability to suffice their needs better than an actual
automated robotic voice. However, the ability of these chat bots to actually reach the
intelligence level of the human beings is still quite far and this has been evaluated through a
test called Turing Test. This test has been designed by Allen Turing in order to measure and
exhibit the intelligence level of the bots and it is through this test it has been established that
the chat bots are still quite far from reaching the intelligence level of the human beings. The
chat bots are being computerised to reply in the flow natural language processing that has
been made to connect the robotic language with that of the real human language. However,
most of these chat bots are designed to reply the user with reference to the most used key
words that has been recorded through the search engine and also from the record and data
from the user’s end. These keywords and the user information are stored in the device and
has been gathered from the database, from where the chat bot collects the relevant replies
for the user queries. This computerized chat bots are therefore highly functional in
establishing a good customer service and has been highly functional in various devices to
serve the users with complains and queries.

These customized chat bots are highly efficient in able to connect with the user
queries and they are functional in devices like Facebook Messenger, Google Assistant and
Amazon Alexa. These devices have equipped the artificial intelligence delicately and
efficiently in order to serve customers and users with a simulation like that of a human voice.
This highly efficient and dextrous software has been made in order to emphasize the mode
of communication and simplify the way in which communication can be established through
higher effective technology. This software can be used through websites, or even through
the telephone in which a human like voiced will be functional in simulating the message that
the user wants to know or needs to get hold of. The Chatbot can help the user with various
queries like finding their required files or important contacts.

13
Chatbot designing

Requirements

For any kind of web application, it has its own specification where it will function
properly and it has its separate list of requirements that is most needed to work or run the
application. For designing a chat bot there are different kinds of requirements, some are for
interacting with the users, some for backend processes and others for handling the database
and the host servers. These all are discussed in brief in this section.

Functional requirements

For any chat bot, there will be two end, one is from client side and other one is from
the server side. In the server side it is required to discuss about the working process of the
proposed design of chat bot. In some cases the server sides generates an automatic response
with the help of API’s and other AI extensions, but for getting better experience and making
the chat bot more helpful to the user one can also implement the user to user interaction in
the chat bot system.

 Developers can apply Json application to get the header content of the chat
system
 One can use the web based API to interact with the client server to maintain
the connection from the both ends
 NLP (natural language processing) this one is one of the important
requirement of any kind of web based chat bot application, however in new
technologies developers does not uses the NLP but they simply follow the
flow chart for this work. NLP is basically a language processor based on the
artificial intelligence concept which provides the application to read the
instruction when the user from the admin end is unavailable. The
implementation of AI provides the benefit of real time experience to the user
with more authentic data and information.

Servers

Hosts are the important base of any web based application system. Every application
which are working on web based platforms needs a host where the application can be placed
and then can be used globally without any interference. Servers provides a home place for
the application and the developer to upload and tore the application.

Database

14
Chatbot designing

Everything inside the application is connected with the database. These can use an
expert system with the wider knowledge base or can use the generated database from the
server end to get the response or to store the information related to the users and their
messaging. For better performance it is always advices to store the database of the
conversation so that they can be used by the users and should be recovered by the user
whenever they will need.

15
Chatbot designing

Chapter 3.Design/architecture

For a chat bot application the architecture and the design of the chat bot plays a key
role. The application must be designed in such a way that the application should be user
friendly from both the ends (client side and the server side). A working process of a model
chat bot is described in the below listed figure.

Figure: - working model of a chatbot

(Source:- created by learner)

As one can see from this figure about the proposed work flow of the chat bot that the
user will send a message with his device application then the bot will catch that source of
information and will respond according to that. Behind the work process of bot NLP will do
the rest process (NLP is the combination of NLU and NLG).

Simple chat application architecture:-

This one is a simple chat application architecture in which the user sends the message
to the sever’s and the bot get the signals from the database and resends back to the user
through the same medium.

16
Chatbot designing

Figure: - architecture of chat application

(Source: - created by learner)

Database connectivity architecture:-

Database of the application can be divided in three parts one for the client, second
for the server and third for the bot, or for the end user from the other side. The messages sent
by the client will get stored in the first database and the server will act as an intermediate
between these two (client and bot). In the bot’s database it will contain the fed data by the
admin and will send the message to the server and then the server will send it to the user or
client. This whole database structure can be merged in a single database if we use any cloud
based services for this chat application.

17
Chatbot designing

Server side

server side
client side

Chat Server Bot

Architecture for a real time chat application:-

In a real time chat application at the both end user have to perform. The main process
of the kind of architecture is depended on the designing of the database and the servers. In
this design the user send the messages from his side through the HTTP protocols, the
allocated server will connect with the database of the system and then will respond the
possible message as it get from the applications database and on the other side in that
database the second user will do the same process, meanwhile database will act as a junction
for the message transfer (Cahn and J, 2017). It will collect and transfer the messages from
one end to the other end.

API implementation

In this project we will use steerbo chat bot builder to use it as API. The reason behind
using this API s that it provides to create the NLU of the users choice which will give an
extra advantage of utilizing the choice of preferred language processing.

Conversational user experience design (CUX)

CUX is front end part of this chat bot application. It will provide the interface for
conversation to the user from the both end, one from the user– bot, and also from the bot-
user end. A well designed conversational UX gives the user a better experience of using the
application and makes the application more user friendly with the attractive look, it will also
help the user in time saving purposes (R et.al. 2018.).

18
Chatbot designing

Bot- user interaction

Bot- user interaction consist the level 0 phase of the application, it replies to the user
with the messages which he collects from the database and other sources.

User bot interaction

User to bot interaction have the same process but in opposite flow, the user sends his
message to the bot from his end to get the response.

Dialog designing

A proper dialog system should be included in the chat bot application, because the
problem behind this is in some cases chat applications are unable to store the users message
in their database and hence due to this they are unable to create a proper dialog system, to
avoid this kind of thing the developer must have to develop a proper dialog design in this
chat application (Abdul-Kader et. al. 2015).

Administrative control

Administrative tools are required for this application to manage the users interaction
to this system and the handling their user activity. Also to train the bot or in other word we
can say that to feed the data into the knowledge base these tools are required. Administrative
access are provided to control and maintain the whole functional process of the chat bot and
this makes it important to implement in any kind of the chat bot.

Security and miscellaneous features

Security is the main issue for any kind of the web based application, it is very
important for the developers to gain the users trust with his application. In a application like
chat bot developer must have to include the security features like to secure the users basic
information and to secure and protect their conversation from others, these are the basic
features which must be included in the chat bot so that to make it secure and to gain the
user’s trust.

Limitations for Chatbot

Chatbots are straight linked with the trades to understand their weaknesses is an
important portion. There are some limitations for users and business owned have complained

19
Chatbot designing

about them. These limitations of chatbots have closed different companies from deploying
chatbots on their websites and applications. The limitations of a chatbot are shown below:

1. Chatbots do not recognize the human perspective

It is an essential limitation of the chatbot. These chatbots are planned in a manner in


which they know what they are trained. They cannot considerate the perspective of humans
and this creates a huge gap that can even lead to a furious consumer. The smart bots can
appreciate the normal perspective, but only out of 100 cases are not connected to the normal
context.

2. Chatbots can’t make decisions

Another limitation of chatbots is they lack in making decisions. They do not have the
obey to know the process of differentiating between the bad and the good. It has done many
damages to different brands due to their lack of decision-making power.

3. Chatbots do not do customer preservation

Retaining a consumer is an important portion of each company. It takes extreme


significance than receiving new consumers. A chatbot has an extreme lack of capacity for
retaining the consumers as it tries up to a stage for that it is planned and programmed. It is
seen that the human executives are superior at consumer retention because they can connect
to the emotions of the consumers that is not the case with chatbots.

4. Excessive installation

Chatbot saves individuals a huge amount of money in the long term but the
installation cost can fracture the bank. Everyone require to hire experts who have correctly
planned and programmed chatbots to match the honesty of the business. The installing
chatbots service meaning the business must be ready for considerable investment into the
learning of machine and artificial intelligence.

5. Chatbots have a similar answer to the question

Most of the consumers do not continue with the chat in the time if they know they
are discussing with a chatbot. Chatbots are simply specialized for they have a similar answer
to different questions. For example, someone is asking something to a bot that is not
obtainable in the data server for an individual will obtain an explanation. Similar case with

20
Chatbot designing

the other questions, no matter the queries are different, the chatbot will distribute individual
the same apology and explanation and that is very irritating.

6. Chatbots have no feelings

They do not have any emotions and they cannot connect to any lack of condition.
Having no feelings meaning a chatbot can never set up a relation with the consumer that is
important for the improvement of any business. The chatbots without emotions examine
knowledge will deal with the consumers in a specific manner irrespective of the chat flow.
For this reason, some consumer prefers to close the chat.

7. Chatbots have research skills in zero level

The cruel reality of Chabot is that they have research skills at the zero levels. Chatbot
have the answers to the questions that are accessible in the system. Chatbot cannot research
for fresh themes on the web. The power of memorizing of a chatbot is extremely less.
Chatbot cannot remember anything until they are fed with fresh samples and repeated
teaching that is expensive and also time-consuming.

Features of chatbot

1. Omni capable

The chatbot converses flawlessly transversely different digital channels and retains
context and data for a flawless experience. In the best cases, even ephemeral that data to a
live manager if required.

2. Conversational Maturity

A good chatbot has particular natural language processing capacities to understand a


discussion in different languages. A chatbot can also recognize the intent of a query that
clarifies the content. The good chatbots have superior capabilities of conversation and can
proactively want the information and can ask clarifying questionaries’ even if the discussion
is not linear.

3. Emotionally clever

The chatbot can deduce consumer personality character and considerate emotions
and tone through interaction to transport an experience that is personalized or spiral to a live
agent when it is essential.

21
Chatbot designing

4. Free to discover

The chatbot can consume, reach and method huge amounts of information and data
for both structured and unstructured to surface insights from any resource to collect authentic
data to sole the consumer problems speedily.

5. Integrates with CRM

The chatbot can be included with the important systems and arrange flows of work
inside and outside the CRM. A chatbot can handle original time activity as routine as a
password alter. All the manner through a compound multi stage flow of work across different
applications.

6. Independent Reasoning

The chatbot can achieve complex reasoning without intervention of human. For
example, a well chatbot must be capable to infer solutions based on significant case histories.

7. Pre trained

The chatbot is pre trained to considerate brand particular or industry particular


knowledge, terms and conditions. Chatbot is pre-configured to decide common consumer
requests of a specific industry.

8. Exit Button

Chatbots are figured to replace humans, people at times require to discuss to a real
human. For make the chatbot perfect, individual require to have an exit button. This will
accept the user to select if they seek to interact with individual’s chatbot and they want to
carry on the discussion with an original human.

9. Visualize it

Emoji’s makes a conversation better. With the use of emoji’s with individuals chatbot
creates the discussion helpful and fun. Over use of emoji’s also create huge problem because
the chatbot is full of emoji’s. Then in the time of business it creates issues.

10. Social Media addition

22
Chatbot designing

In this days social media is important. In the time of building the chatbot, make sure
about that it has social media option on it. Having the capacity to present the social media
world will all time be there for the chatbot.

11. Subscriptions

Chatbots keep developing and individual require more features in it and also
subscriptions. It basically the most essential features of a chatbot. The users require to have
the capability to choose the content they desire to subscribe.

12. Broadcasting

If someone working on marketing the broadcasting is the important feature. This


selection is a required chatbot list of features.

Impact of chatbot on various companies

All the rush of the dominion of the customer facing technology is chatbots. An
updated chatbots are the advance form of artificial intelligence. Chatbots are rising across
all marketplace, sectors and organizations. Various chatbots have various good impacts on
various businesses. A company must have proper knowledge about which type of chatbots
are used in what kind of business. There are different kinds of chatbots like, rule oriented
and AI powered. Rule oriented chatbots are one type of chatbotswhich are works upon a
specific set of rules. AI power chatbots are those types of chatbots which are working upon
the basis of artificial intelligence and machine learning. There are some exciting chatbots
which can help a company to improve its quality. Those chatbots are Hipmunk’s Hello
chatbots, Instabot, Jarvis, Rightclick, Nat Geo Genius Messenger bot, Geekbots,
Pullstringchatbots. Hipmunk’s Hello chatbots are linked with the travel business. If an
instrabot is incorporated with company website, fast qualifying leads are coming to company
website. Jarvis is very much efficient and can contribute rapid support to business. Some
small companies donot have enough time for online business at that time Rightclick.io comes
in tremendously handy. Net geo genius messenger bot is one type of bot which is replete
with entertainment. Chatbots have many discussions in different companies for many years
and for well reason. Researches verify that the most of the customers accept and prefer
chatbots (Gloor, 2019).

Malicious Utility of Chatbot

Disturbance of emergency and support facilities

23
Chatbot designing

There was an interesting story in the news currently of the process of a boy sent a text
in trouble led to lives being saved. News like this could simplify be set up by malicious actors
to puzzle or overwhelm emergency services for different reasons. In an individual’s eye they
can see the movie about the process of the hacker spoofs 911 operators with chatbots which
are helped to lure the policy away from the bank which the hackers plans about to rob.

Consumer support disturbance and business disruption

Corporate sabotage is an original thing and disturbing an organization’s consumer


support with malicious chatbots is a thing which could possibly already be conducted to some
action. As a startup cofounder if someone read consumer emails and some of them can take
an easy and repeatable form. When someone is asking for orders and accepting them in return,
then easiness is the main key and addition of human touch is the service givers accountability
that creates the malicious customer chatbot’s work that much simple. Something automatic
could be set up to examine text based questionaries’ and the surface consumer interactions to
people within the organization in the time of appears that the chatting consumer is an original
people in require of human assistance, If this type of malicious use begins occurring, it could
be an original issue for startups for that place an extreme worth on positive interactions with
consumers (Boyko, 2017).

Mistreatment and harassment

Inappropriately, harsh people such as evilwill have a freshmissile in their social media
and Twitter stores when they get their hands on malicious chatbots. It is probable to visualize
someone directing out amilitary of them to annoy people and even try to amount the
achievement of their annoyance, and then using machine learning to improve and
familiarizefreshplans and growdiscovery counter events. For sample, a malicious chatbot
could do stuffs like developprogressivelycrueler to anobjectiveindividual over a long period
of stage, apologizing when they stage over a link, and then initial in over on the board at
anadvancedperiod.

24
Chatbot designing

Employing evil people to do bad things

It would not be inordinate for the rest of us, but it’s not hard to visualize it being
completed. A recruitchatbot could begin throughdirecting texts on social media, discussion
and posting conferring to a characteroutline and maybe even a individual history. Then, when
a recruit marks a verge of attention, a human recruiter could be transported into the procedure.
Clearly this method could also be helped to tossdetectives off the trail of the real humans.

Distribution of misrepresentation

When a messagereferring existence can come across as a human relatively than a


chatbot, its texts will achieve a lot trustworthiness. Just visualize if a system of human
apparentchatbots with made online individualities beginreceivingfunctioned up on Twitter
around, a untruthful but catastrophic, if true right about one of two applicants in an
significantappointment. With sufficient chatbots behind it like a network might be capable to
reach something like artificial social proof.

Literature Gap

The mainstudy on chatbotsinvolves the importance of the exterior andinterior factors


that disturbthe chatbot. The lessons alsosuggest that the chatbot is heavily influenced by the
particularities of thecompetitive environment that determines the standardizations and service
or product qualityrelated with the main sources of income generation for the companies. The
study on chatbotphases on the importance of chatbots in social media and company progress.
Moreover, the studies on chatbot imply that the chatbot is oftenmeasured by the features of
the chatbot. The current research strives to ascertain the topicchatbot by assessing relevant
literature alongside the scenario of an chatbot. Nevertheless, theresearch endeavors to
evaluate the significance of internal and external features alongside thechatbot for a business
development. Moreover, the current research willshed light into the intricacies ofchatbots that
envisions growth and competency for an organisation.

25
Chatbot designing

Chapter 4: Objectives and milestone

Identified user problems

The first question to answer is "Which customer problems should the chatbot be able
to handle?” This is a non-trivial issue since the problems should be

1. Common enough to provide enough training samples.

2. Simple to resolve so as to limit the chatbot’s potential mistakes.

A few user scenarios were thus identified, with the help of customer support
representatives, as adequate for this project. They are summarised in Table 3.1.

Chapter 5: Software Architecture

5.1 Agent environment

Figure 4.1: Agent environment model.

26
Chatbot designing

5.2 Class diagram

In this section, the connections between all the agent’s modules will be highlighted and
discussed. Figure 4.2 shows the class diagram of the agent’s modules.

Figure 4.2: Chatbot class diagram.

As can be clearly seen from this diagram, the chatbot is made of several components
each solving one particular problem. The component labelled Client at the top of the diagram
is simply a generic client program that makes use of the chatbot. It can simply be a terminal
client or a more complicated dynamic online listener that fetches new tickets when they are
issued through the system. The chatbot’s 5 main components are : IntentClassifier,
HumanRequester, ActionPlanner, ContextManager, and ActionExecutor.

Action planner

27
Chatbot designing

In the process of development of the Chat bot the learner has planned the deissertatiion
with implementing two concepts together.one is from the backend simulator and the other one
form the Backend API

In particular, it is also shown that the ActionPlanner has access to 2 submodules, one
of which (BackendInterface) being shared with another submodule.

Chapter 6: Software implementation

Software systems are the most important thing which is to be implemented in a device
so that the user can run that application and can perform their task. In the case this chat bot
system has a lot of specifications and the features which is required to be implemented with
the system to run it properly. For implementation of the system we require a list of things which
should be included with the system and the Pc.

The basic key term of a software is the implementation of that software or that
application with their appropriate environment. Here the environment directs about the
variables and the parameter which is needed to install and run that software. There are different
variables and parameters needed for the different kinds of the software, like for the applications
which are based on java needs different parameter than those applications which are based on
the . NET or other programming languages. The dependency on the environment variables
makes the application weaker. Variables and the parametric component of the software
application can vary according to their build and the development processes. At the time of
development developer sets some set of variables so that the developed system can adopt the
environment and the specification of that system where this program has to be installed.

Discussion on the software implemnetaion


In this chapter it is clearly discussed about the implementation and installation of the
application to the computer system or in any other device.The researcher has clearly discussed
about the scenario and the situation of the application which he is going to develop.in the newly
developed Chatbot system the programming language which the developer has used is the PHP
and .net and python. With the help of these programming concepts the developer has designed
this chatbot system.

28
Chatbot designing

700000

600000

500000

400000

300000

200000

100000

29
Chatbot designing

Por Sp Ro Ger
Fre Dut En Ser Tur
tug ani ma ma
nch ch glis bia kis
ues sh nia n
h n h
e n

Language

Chapter 7: Experiments and results

For this research the researcher and the developer had done a lot of experiments and
testing’s for the feasibility of the newly developed software. The researcher has selected the
latest and efficient approach for the experiments to test the behaviour and functionality of the
chat bot system.There are different kinds or types of approaches from which we can check the
performance of the chat bot system.

Testing

Testing is theprocess through which a developer checks the performance and the
existing bugs in that application or software. There are different ways of testing. One can do
the testing manually by running the device on live system and checking the functionality of
each and every section of that application. Other way of testing is the software based testing
where the tester connects the application with a testing software and with the help of some
codes and commands the tester checks all its properties one by one. Wherever they gets a bug
they resend that testing report to the development section and the developers again works on
those sections. There are a lot of different software’s available for testing and debugging
purposes.

Discussing about this chatbot system the developer has selected both the methods for
the testing and debugging process (manual and software based). In the manual testing process
the developer installed the newly developed chatbot system in a virtual device NOX.( NOx is
a virtual device or I simple words we can say it is an android simulator which can be installed
on any computer system and in NOx they have a different options to change the environment
of the device.) with this device we checked the performance and the executing speed of the
system.

On the other hand we tested this system with the help of a testing software, on which
we ran this chatbot and injected the testing codes with the chatbot main coding section. With

30
Chatbot designing

this we got the detailed report of the test and debugging. The main purpose of testing a software
is to find the faults and non-functioning parts in that software.

Figure:-conclusion matrix

(Source:- created by user)

Future scope

The future scope of this application is very wide. As we are using is as chat bot system
we can also implement some more API’s so that we can add the features like video calling,
video conferencing and the also for the voice calling. These things are very useful from every
prospect, as from the business point of view if someone is going to develop a chat bot system
then the business organization can use it as their assistant in auto replying to their customers
and also in interacting with their new customers, not only for the customers also for the internal
uses in their organization they can use this application. For an example of the internal use , if
an company decides to use this system as their internal communication tool then it will help
them in many different ways like it will reduce the cost of telephone calls and other paper
material and it will also reduce the time elapsing .

31
Chatbot designing

Discussing about the future scope this system, it is designed for the basic use but if one
can implement more API and latest AI technology with it then it can be more useful for various
purposes. Like if we add an extra API for live tracking of the image or capturing the live videos
then it can be used as a social media platform.

• Additional languages could be trained in order to cover a wider user base.

• More challenging user problems could be investigated. In particular, computer vision


algorithms could be trained to extract information from photos users send of their ID
cards, credit cards, etc...

• A different dynamic version of the chatbot could be designed. This variant would need
to be more reactive than the variant presented in this document by displaying more small-
talk capabilities and creating more direct and customised interactions with customers.
This variant could then be deployed to Facebook and other instant messaging services
that support the use of bots.

• From time to time, users have multiple problems that they would like to address in a
single message. This changes the formulation of the intent classification problem into a
multi-label classification problem. Different methods could be considered to address this
issue.

• If the user is unable to clarify itself, instead of directly requesting a human operator, the
chatbot could suggest potential problems to the user in the form of a selection list with
common problems. There could also be the option to request a human agent in this list
to prevent users from getting frustrated with the bot.

32
Chatbot designing

Chapter 8: Conclusion

In conclusion we can say that the proposed design and structure of this chat bot
application is very effective and can be implemented easily on the server. As a developer after
reading this draft I am cent percent sure about the work flow and responsiveness of this
application. The real time chat application provides the user an advantage to interact with the
person to person. This chat application can be used for the purpose of business and the cab be
used for the individual application like social media tool. As mentioned in this draft about the
uses and implementation of API’s and other AI technologies it enhances the work efficiency
of this chat system. AI provides a lot of extra features to the application, on the other hand API
helps in making the application more responsive and adding too many extra features in this
application.

33
Chatbot designing

34
Chatbot designing

References

Abashev, A., Grigoryev, R., Grigorian, K. and Boyko, V., 2017. Programming tools for
messenger-based chatbot system organization: Implication for outpatient and translational
medicines. BioNanoScience, 7(2), pp.403-407.

Brendel, A.B., Zapadka, P. and Kolbe, L., 2018. Design Science Research in Green IS-
Analyzing the Past to Guide Future Research. In ECIS (p. 115).

Ciechanowski, L., Przegalinska, A., Magnuski, M. and Gloor, P., 2019. In the shades of the
uncanny valley: An experimental study of human–chatbot interaction. Future Generation
Computer Systems, 92, pp.539-548.

Ciechanowski, L., Przegalinska, A., Magnuski, M. and Gloor, P., 2019. In the shades of the
uncanny valley: An experimental study of human–chatbot interaction. Future Generation
Computer Systems, 92, pp.539-548.

Fawcett, A.C. and Peacock, J.D., Sage Global Services Ltd, 2019. Chatbot system. U.S. Patent
Application 16/219,282.

Fryer, L.K., Ainley, M., Thompson, A., Gibson, A. and Sherlock, Z., 2017. Stimulating and
sustaining interest in a language course: An experimental comparison of Chatbot and Human
task partners. Computers in Human Behavior, 75, pp.461-468.

Hill, J., Ford, W.R. and Farreras, I.G., 2015. Real conversations with artificial intelligence: A
comparison between human–human online conversations and human–chatbot
conversations. Computers in Human Behavior, 49, pp.245-250.

Huang, J.X., Lee, K.S., Kwon, O.W. and Kim, Y.K., 2017. A chatbot for a dialogue-based
second language learning system. CALL in a climate of change: adapting to turbulent global
conditions, p.151.

Kamita, T., Ito, T., Matsumoto, A., Munakata, T. and Inoue, T., 2019. A Chatbot System for
Mental Healthcare Based on SAT Counseling Method. Mobile Information Systems, 2019.

Latioui, Z.E., Bougueroua, L. and Moretto, A., 2018, December. Social Media Chatbot System-
Beekeeping Case Study. In International Conference on Hybrid Intelligent Systems (pp. 302-
310). Springer, Cham.

35
Chatbot designing

Pereira, M.J., Coheur, L., Fialho, P. and Ribeiro, R., 2016. Chatbots' greetings to human-
computer communication. arXiv preprint arXiv:1609.06479.

Schmidt, R.W., 2018. Learning System Customer Service Chatbot. Georgia Institute of
Technology.

Sharma, V., Goyal, M. and Malik, D., 2017. An Intelligent Behaviour Shown by Chatbot
System. International Journal of New Technology and Research, 3(4).

Sharma, V., Goyal, M. and Malik, D., 2017. An Intelligent Behaviour Shown by Chatbot
System. International Journal of New Technology and Research, 3(4).

Appendix
// Easy Responsive Tabs Plugin

// Author: Ankit.Luhar<Email : ankitluhar70@gmail.com>

(function ($) {

$.fn.extend({

easyResponsiveTabs: function (options) {

//Set the default values, use comma to separate the settings, example:

var defaults = {

type: 'default', //default, vertical, accordion;

width: 'auto',

fit: true

//Variables

var options = $.extend(defaults, options);

var opt = options, jtype = opt.type, jfit = opt.fit, jwidth = opt.width, vtabs = 'vertical',
accord = 'accordion';

36
Chatbot designing

//Main function

this.each(function () {

var $respTabs = $(this);

$respTabs.find('ul.resp-tabs-list li').addClass('resp-tab-item');

$respTabs.css({

'display': 'block',

'width': jwidth

});

$respTabs.find('.resp-tabs-container > div').addClass('resp-tab-content');

jtab_options();

//Properties Function

function jtab_options() {

if (jtype == vtabs) {

$respTabs.addClass('resp-vtabs');

if (jfit == true) {

$respTabs.css({ width: '100%', margin: '0px' });

if (jtype == accord) {

$respTabs.addClass('resp-easy-accordion');

$respTabs.find('.resp-tabs-list').css('display', 'none');

37
Chatbot designing

//Assigning the h2 markup

var $tabItemh2;

$respTabs.find('.resp-tab-content').before("<h2 class='resp-accordion'
role='tab'><span class='resp-arrow'></span></h2>");

var itemCount = 0;

$respTabs.find('.resp-accordion').each(function () {

$tabItemh2 = $(this);

var innertext = $respTabs.find('.resp-tab-item:eq(' + itemCount + ')').text();

$respTabs.find('.resp-accordion:eq(' + itemCount + ')').append(innertext);

$tabItemh2.attr('aria-controls', 'tab_item-' + (itemCount));

itemCount++;

});

//Assigning the 'aria-controls' to Tab items

var count = 0,

$tabContent;

$respTabs.find('.resp-tab-item').each(function () {

$tabItem = $(this);

$tabItem.attr('aria-controls', 'tab_item-' + (count));

38
Chatbot designing

$tabItem.attr('role', 'tab');

//First active tab

$respTabs.find('.resp-tab-item').first().addClass('resp-tab-active');

$respTabs.find('.resp-accordion').first().addClass('resp-tab-active');

$respTabs.find('.resp-tab-content').first().addClass('resp-tab-content-
active').attr('style', 'display:block');

//Assigning the 'aria-labelledby' attr to tab-content

var tabcount = 0;

$respTabs.find('.resp-tab-content').each(function () {

$tabContent = $(this);

$tabContent.attr('aria-labelledby', 'tab_item-' + (tabcount));

tabcount++;

});

count++;

});

//Tab Click action function

$respTabs.find("[role=tab]").each(function () {

var $currentTab = $(this);

$currentTab.click(function () {

39
Chatbot designing

var $tabAria = $currentTab.attr('aria-controls');

if ($currentTab.hasClass('resp-accordion') && $currentTab.hasClass('resp-tab-


active')) {

$respTabs.find('.resp-tab-content-active').slideUp('', function () {
$(this).addClass('resp-accordion-closed'); });

$currentTab.removeClass('resp-tab-active');

return false;

if (!$currentTab.hasClass('resp-tab-active') && $currentTab.hasClass('resp-


accordion')) {

$respTabs.find('.resp-tab-active').removeClass('resp-tab-active');

$respTabs.find('.resp-tab-content-active').slideUp().removeClass('resp-tab-
content-active resp-accordion-closed');

$respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-


active');

$respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria +


']').slideDown().addClass('resp-tab-content-active');

} else {

$respTabs.find('.resp-tab-active').removeClass('resp-tab-active');

$respTabs.find('.resp-tab-content-
active').removeAttr('style').removeClass('resp-tab-content-active').removeClass('resp-
accordion-closed');

$respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-


active');

40
Chatbot designing

$respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria +


']').addClass('resp-tab-content-active').attr('style', 'display:block');

});

//Window resize function

$(window).resize(function () {

$respTabs.find('.resp-accordion-closed').removeAttr('style');

});

});

});

});

})(jQuery);

Html file

// Easy Responsive Tabs Plugin

// Author: Samson.Onna <Email : samson3d@gmail.com>

(function ($) {

$.fn.extend({

easyResponsiveTabs: function (options) {

//Set the default values, use comma to separate the settings, example:

var defaults = {

type: 'default', //default, vertical, accordion;

width: 'auto',

41
Chatbot designing

fit: true

//Variables

var options = $.extend(defaults, options);

var opt = options, jtype = opt.type, jfit = opt.fit, jwidth = opt.width, vtabs = 'vertical',
accord = 'accordion';

//Main function

this.each(function () {

var $respTabs = $(this);

$respTabs.find('ul.resp-tabs-list li').addClass('resp-tab-item');

$respTabs.css({

'display': 'block',

'width': jwidth

});

$respTabs.find('.resp-tabs-container > div').addClass('resp-tab-content');

jtab_options();

//Properties Function

function jtab_options() {

if (jtype == vtabs) {

$respTabs.addClass('resp-vtabs');

42
Chatbot designing

if (jfit == true) {

$respTabs.css({ width: '100%', margin: '0px' });

if (jtype == accord) {

$respTabs.addClass('resp-easy-accordion');

$respTabs.find('.resp-tabs-list').css('display', 'none');

//Assigning the h2 markup

var $tabItemh2;

$respTabs.find('.resp-tab-content').before("<h2 class='resp-accordion'
role='tab'><span class='resp-arrow'></span></h2>");

var itemCount = 0;

$respTabs.find('.resp-accordion').each(function () {

$tabItemh2 = $(this);

var innertext = $respTabs.find('.resp-tab-item:eq(' + itemCount + ')').text();

$respTabs.find('.resp-accordion:eq(' + itemCount + ')').append(innertext);

$tabItemh2.attr('aria-controls', 'tab_item-' + (itemCount));

itemCount++;

});

43
Chatbot designing

//Assigning the 'aria-controls' to Tab items

var count = 0,

$tabContent;

$respTabs.find('.resp-tab-item').each(function () {

$tabItem = $(this);

$tabItem.attr('aria-controls', 'tab_item-' + (count));

$tabItem.attr('role', 'tab');

//First active tab

$respTabs.find('.resp-tab-item').first().addClass('resp-tab-active');

$respTabs.find('.resp-accordion').first().addClass('resp-tab-active');

$respTabs.find('.resp-tab-content').first().addClass('resp-tab-content-
active').attr('style', 'display:block');

//Assigning the 'aria-labelledby' attr to tab-content

var tabcount = 0;

$respTabs.find('.resp-tab-content').each(function () {

$tabContent = $(this);

$tabContent.attr('aria-labelledby', 'tab_item-' + (tabcount));

tabcount++;

});

count++;

});

44
Chatbot designing

//Tab Click action function

$respTabs.find("[role=tab]").each(function () {

var $currentTab = $(this);

$currentTab.click(function () {

var $tabAria = $currentTab.attr('aria-controls');

if ($currentTab.hasClass('resp-accordion') && $currentTab.hasClass('resp-tab-


active')) {

$respTabs.find('.resp-tab-content-active').slideUp('', function () {
$(this).addClass('resp-accordion-closed'); });

$currentTab.removeClass('resp-tab-active');

return false;

if (!$currentTab.hasClass('resp-tab-active') && $currentTab.hasClass('resp-


accordion')) {

$respTabs.find('.resp-tab-active').removeClass('resp-tab-active');

$respTabs.find('.resp-tab-content-active').slideUp().removeClass('resp-tab-
content-active resp-accordion-closed');

$respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-


active');

$respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria +


']').slideDown().addClass('resp-tab-content-active');

45
Chatbot designing

} else {

$respTabs.find('.resp-tab-active').removeClass('resp-tab-active');

$respTabs.find('.resp-tab-content-
active').removeAttr('style').removeClass('resp-tab-content-active').removeClass('resp-
accordion-closed');

$respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-


active');

$respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria +


']').addClass('resp-tab-content-active').attr('style', 'display:block');

});

//Window resize function

$(window).resize(function () {

$respTabs.find('.resp-accordion-closed').removeAttr('style');

});

});

});

});

})(jQuery);

CSS file:-

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,a
ddress,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,dl
,dt,dd,ol,nav ul,nav

46
Chatbot designing

li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,
embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,m
ark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-
align:baseline;}

article, aside, details, figcaption, figure,footer, header, hgroup, menu, nav, section {display:
block;}

ol,ul{list-style:none;margin:0px;padding:0px;}

blockquote,q{quotes:none;}

blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}

table{border-collapse:collapse;border-spacing:0;}

/* start editing from here */

a{text-decoration:none;}

.txt-rt{text-align:right;}/* text align right */

.txt-lt{text-align:left;}/* text align left */

.txt-center{text-align:center;}/* text align center */

.float-rt{float:right;}/* float right */

.float-lt{float:left;}/* float left */

.clear{clear:both;}/* clear float */

.pos-relative{position:relative;}/* Position Relative */

.pos-absolute{position:absolute;}/* Position Absolute */

.vertical-base{ vertical-align:baseline;}/* vertical align baseline */

.vertical-top{ vertical-align:top;}/* vertical align top */

nav.vertical ul li{ display:block;}/* vertical menu */

nav.horizontal ul li{ display: inline-block;}/* horizontal menu */

47
Chatbot designing

img{max-width:100%;}

/*end reset*/

body{

padding:0;

margin:0;

font-family: 'Open Sans', sans-serif;

background: url(../images/111.jpeg) repeat;

h1,h2,h3,h4,h5,h6{

margin:0;

p{

margin:0;

ul{

margin:0;

padding:0;

label{

margin:0;

48
Chatbot designing

/*-- main --*/

.main {

padding: 50px 0;

.main h1{

font-size:35px;

text-align:center;

text-transform:uppercase;

color:#B3E03F;

margin-bottom: 25px;

font-family: 'Fugaz One', cursive;

.content{

width:40%;

margin:0 auto;

p.footer {

color: #3AD5A0;

text-align: center;

font-size: 14px;

margin-top: 35px;

font-weight: 600;

49
Chatbot designing

p.footer a{

color:#3AD5A0;

p.footer a:hover{

color: #B3E03F;

/******** SAP ************/

.sap_tabs{

clear:both;

padding: 0em 0 0em;

.pay-tabs{

margin: 0 0 2em 0;

padding: 1em 1em 1.5em 1em;

background: #fff;

border: 1px solid #e7ebee;

.pay-tabs h2{

font-size: 26px;

text-align: center;

margin-bottom: 25px;

color: #3AD5A0;

font-weight: 500;

50
Chatbot designing

font-family: 'Alegreya Sans', sans-serif;

.resp-tabs-list {

list-style: none;

margin: 0 0 0em 0;

padding: 0;

.resp-tab-item{

font-size: 14px;

text-decoration: none;

color: #a9acb1;

font-weight:600;

cursor: pointer;

text-align: center;

list-style: none;

outline: none;

-webkit-transition: all 0.3s ease-out;

-moz-transition: all 0.3s ease-out;

-ms-transition: all 0.3s ease-out;

-o-transition: all 0.3s ease-out;

transition: all 0.3s ease-out;

text-transform:capitalize;

display: inline-block;

51
Chatbot designing

margin: 0 4%;

float: left;

width: 17%;

.resp-tab-active{

color: #B3E03F;

.resp-tabs-container {

padding: 0px;

clear: left;

padding: 2em 2.5em;

background: #fff;

border: 1px solid #e7ebee;

h2.resp-accordion {

cursor: pointer;

padding: 5px;

display: none;

.resp-tab-content {

display: none;

.resp-content-active, .resp-accordion-active {

52
Chatbot designing

display: block;

li.resp-tab-item span .pic1{

background: url(../images/pic2.png) no-repeat 38px 15px #fafafa !important;

li.resp-tab-item span .pic2{

background: url(../images/pic3.png) no-repeat 38px 15px #fafafa !important;

li.resp-tab-item span .pic3{

background: url(../images/pic1.png) no-repeat 14px 15px #fafafa !important;

li.resp-tab-item span .pic4{

background: url(../images/pic4.png) no-repeat 38px 15px #fafafa !important;

li.resp-tab-item span .pic1,li.resp-tab-item span .pic2,li.resp-tab-item span .pic3,li.resp-tab-


item span .pic4{

width: 100%;

height: 32px;

display: block;

border: 1px solid #e7ebee;

53
Chatbot designing

padding: 15px 0px;

margin-bottom: 15px;

cursor:pointer;

li.resp-tab-item.resp-tab-active span label {

border: 1px solid #B3E03F;

.payment-info h3{

font-size: 26px;

text-align: center;

margin-bottom: 15px;

color: #3AD5A0;

font-weight: 500;

font-family: 'Alegreya Sans', sans-serif;

.tab-for input[type="text"] {

width:96%;

padding: 8px;

font-size: 13px;

font-weight: 600;

border: 1px solid #e7ebee;

outline: none;

color: #ccc;

54
Chatbot designing

border-radius: 5px;

margin-bottom: 20px;

transition:0.5s all;

-webkit-transition:0.5s all;

-moz-transition:0.5s all;

-o-transition:0.5s all;

-ms-transition:0.5s all;

.tab-for h5 ,.tab-form-left h5,.tab-form-right h5{

color: #435964;

font-size: 13px;

text-transform: uppercase;

margin: 0 0 8px 0;

font-weight: 600;

.tab-for input[type="text"]:hover{

border: 1px solid #B3E03F;

transition:0.5s all;

-webkit-transition:0.5s all;

-moz-transition:0.5s all;

-o-transition:0.5s all;

-ms-transition:0.5s all;

55
Chatbot designing

input.pay-logo{

width: 89.5% !important;

padding: 8px 45px 8px 8px !important;

background: url(../images/visa.png) no-repeat 507px 5px;

.tab-form-left {

float: left;

width: 48%;

.user-form ul li {

list-style-type: none;

display: inline-block;

width: 23%;

margin-right: 9%;

.text_box {

display: inline;

width: 60px;

padding: 3px 5px;

outline: none;

margin-left: 1%;

font-size: 20px;

color: #444;

56
Chatbot designing

width: 100%;

color: #606060;

font-size: 15px;

padding: 8px 0 8px 10px;

border: none;

outline: none;

background: #fff;

transition: 0.5s all;

-webkit-transition: 0.5s all;i

-moz-transition: 0.5s all;

-o-transition: 0.5s all;

-ms-transition: 0.5s all;

input.text_box {

background: #fcfcfc;

border: 1px solid #ebeced;

.tab-form-right {

float: right;

width: 48%;

.tab-form-right input[type="text"] {

width:92%;

57
Chatbot designing

padding: 8px;

font-size: 13px;

font-weight: 600;

border: 1px solid #e7ebee;

outline: none;

color: #ccc;

border-radius: 5px;

margin-bottom: 30px;

transition:0.5s all;

-webkit-transition:0.5s all;

-moz-transition:0.5s all;

-o-transition:0.5s all;

-ms-transition:0.5s all;

.tab-form-right input[type="text"]:hover{

border: 1px solid #B3E03F;

transition:0.5s all;

-webkit-transition:0.5s all;

-moz-transition:0.5s all;

-o-transition:0.5s all;

-ms-transition:0.5s all;

.payment-info form input[type="submit"] {

58
Chatbot designing

background: #B3E03F;

color: #FFFFFF;

text-align: center;

padding: 10px 0;

border: none;

font-size: 16px;

outline: none;

width: 22%;

cursor: pointer;

font-weight: 600;

margin-bottom:30px;

transition: 0.5s all;

-webkit-transition: 0.5s all;

-moz-transition: 0.5s all;

-o-transition: 0.5s all;

-ms-transition: 0.5s all;

.payment-info form input[type="submit"]:hover{

background: #3AD5A0;

transition: 0.5s all;

-webkit-transition: 0.5s all;

-moz-transition: 0.5s all;

-o-transition: 0.5s all;

59
Chatbot designing

-ms-transition: 0.5s all;

.single-bottom ul li{

list-style:none;

padding:0px;

.single-bottom ul li input[type="checkbox"] {

display: none;

.single-bottom ul li input[type="checkbox"]+label {

position: relative;

padding-left: 31px;

border: none;

outline: none;

font-size: 13px;

color: #2d3e50;

font-weight:600;

line-height:1.8em;

.single-bottom ul li input[type="checkbox"]+label span:first-child {

width: 14px;

height: 14px;

60
Chatbot designing

display: inline-block;

border: 2px solid #B3E03F;

position: absolute;

left: 0;

top: 1px;

.single-bottom ul li input[type="checkbox"]:checked+label span:first-child:before {

content: "";

background:url(../images/11.png)no-repeat;

position: absolute;

left: -1px;

top: 0px;

font-size: 10px;

width:16px;

height:16px;

.radio {

position: relative;

display:inline-block;

margin-left:15px;

.radio:first-child {

margin-left: 0;

61
Chatbot designing

margin: 0;

.radio {

padding-left:22px;

line-height: 28px;

color: #404040;

cursor: pointer;

.radio input[type="radio"]{

position: absolute;

left: -9999px;

.radio-btns label {

font-size: 14px;

color: #000;

padding: 0px 0 0 10px;

font-weight:600;

.radio i {

position: absolute;

top:5px;

left: 0;

display: block;

62
Chatbot designing

width: 12px;

height: 12px;

outline: none;

border:3px solid #B5E045;

background: #fff;

cursor:pointer;

.radio i {

border-radius: 50%;

.radio input + i:after {

position: absolute;

opacity: 0;

transition: opacity 0.1s;

-o-transition: opacity 0.1s;

-ms-transition: opacity 0.1s;

-moz-transition: opacity 0.1s;

-webkit-transition: opacity 0.1s;

.radio input + i:after {

content: '';

top: 6px;

left: 7px;

63
Chatbot designing

width: 5px;

height: 5px;

border-radius: 50%;

-webkit-border-radius: 50%;

-moz-border-radius: 50%;

-o-border-radius: 50%;

.radio input:checked + i:after{

opacity: 1;

label.checkbox {

width: 28%;

floaT: left;

/*** normal state ***/

.radio i {

transition: border-color 0.3s;

-o-transition: border-color 0.3s;

-ms-transition: border-color 0.3s;

-moz-transition: border-color 0.3s;

-webkit-transition: border-color 0.3s;

64
Chatbot designing

/*** checked state ***/

.radio input + i:after {

content: '';

background: url("../images/tick-mark1.png") no-repeat center;

top: 1px;

left: 1px;

width: 9px;

height: 9px;

text-align: center;

.radio input:checked + i {

border:3px solid #B5E045;

background: #fff;

.swit{

float:left;

width:50%;

.check_box {

margin-bottom: 5px;

.payment-info a{

padding:8px 10px;

65
Chatbot designing

font-size:14px;

color:#fff;

font-weight:600;

text-transform:uppercase;

background:#B5E045;

.payment-info a:hover{

background: #3AD5A0;

.radio-btns{

margin-bottom: 30px;

.login-tab{

margin-top: 15px;

.user-login h2 {

margin: 0 0 18px 0;

color: #424448;

font-size: 24px;

text-align: center;

font-weight: bold;

66
Chatbot designing

.graph-header h3{

margin: 0 0 18px 0;

color: #424448;

font-size: 24px;

text-align: center;

font-weight: bold;

.graph-grid{

background: #fff;

padding: 42px 20px;

margin:15px 0;

.con-btm-l{

float:left;

width:46%;

.con-btm-r{

float: left;

width: 51.5%;

margin-left: 2.5%;

.con-btm-right {

padding-right: 0;

67
Chatbot designing

.user-login form input[type="text"], .user-login form input[type="password"] {

margin: 0 0 24px 0;

background: #fcfcfc;

width: 94%;

padding: 12px 15px;

font-size: 14px;

font-weight: bold;

border: 1px solid #ebeced;

outline: none;

color: #D7D7D7;

.user-login form{

margin-top: 22px;

.user-left i {

font-style: normal;

vertical-align: text-bottom;

font-size: 14px;

font-weight: bold;

margin-left: 5px;

.user-left {

68
Chatbot designing

width: 61%;

float: left;

.user-right {

width: 21%;

float: right;

.user-right input[type="submit"] {

background: #ed5564;

font-weight: bold;

font-size: 16px;

color: #ffffff;

padding: 10px 25px;

border: none;

width: 100% !important;

transition:0.5s all;

-webkit-transition:0.5s all;

-moz-transition:0.5s all;

-o-transition:0.5s all;

-ms-transition:0.5s all;

.user-right input[type="submit"]:hover {

background:#28b08a;

69
Chatbot designing

transition:0.5s all;

-webkit-transition:0.5s all;

-moz-transition:0.5s all;

-o-transition:0.5s all;

-ms-transition:0.5s all;

.payment-info h4 {

font-size: 14px;

text-align: center;

color: #000;

/*-- responsive media queries --*/

@media (max-width: 1440px){

li.resp-tab-item span .pic3 {

background: url(../images/pic1.png) no-repeat 8px 15px #fafafa !important;

li.resp-tab-item span .pic1 {

background: url(../images/pic2.png) no-repeat 29px 15px #fafafa !important;

li.resp-tab-item span .pic4 {

background: url(../images/pic4.png) no-repeat 31px 15px #fafafa !important;

li.resp-tab-item span .pic2 {

70
Chatbot designing

background: url(../images/pic3.png) no-repeat 29px 15px #fafafa !important;

@media (max-width: 1366px){

.content {

width: 41.5%;

margin: 0 auto;

input.pay-logo {

width: 88.5% !important;

@media (max-width: 1280px){

.resp-tab-item {

margin: 0 3%;

width: 19%;

input.pay-logo {

width: 87% !important;

.single-bottom ul li input[type="checkbox"]+label {

padding-left: 24px;

71
Chatbot designing

@media (max-width: 1080px){

.content {

width: 48.5%;

margin: 0 auto;

.tab-form-right input[type="text"] {

width: 91%;

.user-form ul li {

width: 26%;

@media (max-width: 1024px){

.content {

width: 49.5%;

margin: 0 auto;

.swit {

float: left;

width: 44%;

margin-right: 6%;

72
Chatbot designing

@media (max-width: 991px){

.pay-tabs h2 ,.payment-info h3{

font-size: 22px;

.resp-tab-item {

margin: 0 2%;

width: 21%;

.user-form ul li {

width: 29%;

.swit {

margin-right: 12%;

.swit:nth-child(2) {

margin: 0;

@media (max-width: 800px){

.content {

width: 60%;

margin: 0 auto;

73
Chatbot designing

input.pay-logo {

width: 85% !important;

.tab-for input[type="text"] {

width: 95%;

.tab-form-right input[type="text"] {

width: 90%;

.radio-btns label {

font-size: 13px;

color: #000;

padding: 0px 0 0 2px;

font-weight: 600;

.radio i {

top: 6px;

.user-login form input[type="text"], .user-login form input[type="password"] {

width: 92%;

.resp-tab-item {

74
Chatbot designing

font-size: 13px;

.payment-info form input[type="submit"] {

font-size: 14px;

.payment-info h4 {

font-size: 13px;

.main h1 {

font-size: 30px;

@media (max-width: 768px){

.content {

width: 61%;

@media (max-width: 736px){

.content {

width: 64%;

@media (max-width: 667px){

75
Chatbot designing

.content {

width: 71.5%;

@media (max-width: 640px){

.content {

width: 74.5%;

.tab-form-right input[type="text"] {

width: 89%;

p.footer {

font-size: 13px;

@media (max-width: 600px){

.content {

width: 79.5%;

@media (max-width: 568px){

.content {

width: 83.5%;

76
Chatbot designing

@media (max-width: 480px){

.content {

width: 92%;

li.resp-tab-item span .pic3 {

background: url(../images/pic1.png) no-repeat 5px 15px #fafafa !important;

li.resp-tab-item span .pic1 {

background: url(../images/pic2.png) no-repeat 26px 15px #fafafa !important;

li.resp-tab-item span .pic4 {

background: url(../images/pic4.png) no-repeat 27px 15px #fafafa !important;

li.resp-tab-item span .pic2 {

background: url(../images/pic3.png) no-repeat 25px 15px #fafafa !important;

.user-form ul li {

width: 34%;

.tab-form-right {

float: right;

77
Chatbot designing

width: 45%;

p.footer {

font-size: 13px;

line-height: 1.8em;

width: 92%;

margin: 30px auto 0 auto;

.resp-tabs-container {

padding: 1em 1em;

.tab-form-right input[type="text"] {

width: 88%;

.main h1 {

font-size: 25px;

@media (max-width: 414px){

.resp-tab-item {

margin: 0 6%;

width: 38%;

78
Chatbot designing

li.resp-tab-item span .pic1 {

background: url(../images/pic2.png) no-repeat 46px 15px #fafafa !important;

li.resp-tab-item span .pic3 {

background: url(../images/pic1.png) no-repeat 27px 15px #fafafa !important;

li.resp-tab-item span .pic4 {

background: url(../images/pic4.png) no-repeat 50px 15px #fafafa !important;

li.resp-tab-item span .pic2 {

background: url(../images/pic3.png) no-repeat 46px 15px #fafafa !important;

li.resp-tab-item:nth-child(3) ,li.resp-tab-item:nth-child(4){

margin-top: 25px;

.tab-for input[type="text"] {

width: 94%;

input.pay-logo {

width: 83% !important;

.tab-form-right input[type="text"] {

width: 86%;

79
Chatbot designing

.swit {

float: left;

width: 48%;

margin-right: 4%;

.swit:nth-child(2) {

margin: 0;

.user-login form input[type="text"], .user-login form input[type="password"] {

width: 90%;

@media (max-width: 384px){

input.pay-logo {

width: 81% !important;

.user-form ul li {

width: 37%;

li.resp-tab-item span .pic1 {

background: url(../images/pic2.png) no-repeat 42px 15px #fafafa !important;

80
Chatbot designing

li.resp-tab-item span .pic3 {

background: url(../images/pic1.png) no-repeat 20px 15px #fafafa !important;

li.resp-tab-item span .pic4 {

background: url(../images/pic4.png) no-repeat 44px 15px #fafafa !important;

li.resp-tab-item span .pic2 {

background: url(../images/pic3.png) no-repeat 42px 15px #fafafa !important;

.swit {

float: left;

width: 100%;

margin-right: 0;

.user-login form input[type="text"], .user-login form input[type="password"] {

width: 89%;

@media (max-width: 375px){

@media (max-width: 320px){

.main h1 {

81
Chatbot designing

font-size: 20px;

.main {

padding: 45px 0;

.pay-tabs h2, .payment-info h3 {

font-size: 19px;

li.resp-tab-item span .pic1, li.resp-tab-item span .pic2, li.resp-tab-item span .pic3,


li.resp-tab-item span .pic4 {

padding: 12px 0px;

li.resp-tab-item span .pic1 {

background: url(../images/pic2.png) no-repeat 32px 13px #fafafa !important;

li.resp-tab-item span .pic3 {

background: url(../images/pic1.png) no-repeat 10px 11px #fafafa !important;

li.resp-tab-item span .pic4 {

background: url(../images/pic4.png) no-repeat 34px 12px #fafafa !important;

li.resp-tab-item span .pic2 {

background: url(../images/pic3.png) no-repeat 30px 12px #fafafa !important;

82
Chatbot designing

.pay-tabs {

margin: 0 0 1.5em 0;

.tab-for input[type="text"] {

width: 92%;

input.pay-logo {

width: 76.5% !important;

.payment-info form input[type="submit"] {

width: 32%;

margin-bottom: 19px;

.tab-form-left {

float: left;

width: 100%;

.user-form ul li {

width: 42.5%;

margin-right: 6.5%;

.tab-form-right {

83
Chatbot designing

float: right;

width: 100%;

margin-top: 20px;

.tab-form-right input[type="text"] {

width: 92%;

.user-right {

width: 30%;

.payment-info form input[type="submit"] {

padding: 7px 0;

p.footer {

margin: 20px auto 0 auto;

Script.js

/*.

*/

(function(){function
U(a,c){a.prototype=Pa(c.prototype);a.prototype.constructor=a;a.base=c.prototype}function

84
Chatbot designing

Pa(a){function c(){}c.prototype=a;return new c}function


Ia(a,c,b){"millisecond"===b?a.setMilliseconds(a.getMilliseconds()+1*c):"second"===b?a.se
tSeconds(a.getSeconds()+1*c):"minute"===b?a.setMinutes(a.getMinutes()+1*c):"hour"===b
?a.setHours(a.getHours()+1*c):"day"===b?a.setDate(a.getDate()+1*c):"week"===b?a.setDat
e(a.getDate()+7*c):"month"===b?a.setMonth(a.getMonth()+1*c):"year"===b&&a.setFullYe
ar(a.getFullYear()+

1*c);return a}function O(a,c){var b=!1;0>a&&(b=!0,a*=-


1);a=""+a;for(c=c?c:1;a.length<c;)a="0"+a;return b?"-"+a:a}function la(a){if(!a)return
a;a=a.replace(/^\s\s*/,"");for(var c=/\s/,b=a.length;c.test(a.charAt(--b)););return
a.slice(0,b+1)}function
Qa(a){a.roundRect=function(a,b,d,f,g,h,k,l){k&&(this.fillStyle=k);l&&(this.strokeStyle=l);"
undefined"===typeof
g&&(g=5);this.lineWidth=h;this.beginPath();this.moveTo(a+g,b);this.lineTo(a+d-
g,b);this.quadraticCurveTo(a+d,b,a+d,b+g);this.lineTo(a+d,b+f-g);

this.quadraticCurveTo(a+d,b+f,a+d-
g,b+f);this.lineTo(a+g,b+f);this.quadraticCurveTo(a,b+f,a,b+f-
g);this.lineTo(a,b+g);this.quadraticCurveTo(a,b,a+g,b);this.closePath();k&&this.fill();l&&0<
h&&this.stroke()}}function za(a,c){return a-c}function Ja(a,c){return a.x-c.x}function
G(a){var
c=((a&16711680)>>16).toString(16),b=((a&65280)>>8).toString(16);a=((a&255)>>0).toStri
ng(16);c=2>c.length?"0"+c:c;b=2>b.length?"0"+b:b;a=2>a.length?"0"+a:a;return"#"+c+b+a}
function Ra(a,c){var b=this.length>>>0,d=Number(c)||

0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=b);d<b;d++)if(d in
this&&this[d]===a)return d;return-1}function x(a){return null===a||"undefined"===typeof
a}function ra(a){a.indexOf||(a.indexOf=Ra);return a}function Ka(a,c,b){b=b||"normal";var
d=a+"_"+c+"_"+b,f=La[d];if(isNaN(f)){try{a="position:absolute; left:0px; top:-20000px;
padding:0px;margin:0px;border:none;white-space:pre;line-height:normal;font-family:"+a+";
font-size:"+c+"px; font-weight:"+b+";";if(!aa){var
g=document.body;aa=document.createElement("span");

aa.innerHTML="";var
h=document.createTextNode("Mpgyi");aa.appendChild(h);g.appendChild(aa)}aa.style.displa
y="";aa.setAttribute("style",a);f=Math.round(aa.offsetHeight);aa.style.display="none"}catch(

85
Chatbot designing

k){f=Math.ceil(1.1*c)}f=Math.max(f,c);La[d]=f}return f}function I(a,c){var


b=[];if(b={solid:[],shortDash:[3,1],shortDot:[1,1],shortDashDot:[3,1,1,1],shortDashDotDot:[
3,1,1,1,1,1],dot:[1,2],dash:[4,2],dashDot:[4,2,1,2],longDash:[8,2],longDashDot:[8,2,1,2],long
DashDotDot:[8,2,1,2,1,2]}[a||"solid"])for(var d=

0;d<b.length;d++)b[d]*=c;else b=[];return b}function K(a,c,b,d){return


a.addEventListener?(a.addEventListener(c,b,d||!1),b):a.attachEvent?(d=function(d){d=d||win
dow.event;d.preventDefault=d.preventDefault||function(){d.returnValue=!1};d.stopPropagati
on=d.stopPropagation||function(){d.cancelBubble=!0};b.call(a,d)},a.attachEvent("on"+c,d),d)
:!1}function
Ma(a,c,b){a*=Q;c*=Q;a=b.getImageData(a,c,2,2).data;c=!0;for(b=0;4>b;b++)if(a[b]!==a[b+
4]|a[b]!==a[b+8]|a[b]!==a[b+12]){c=!1;break}return c?a[0]<<16|

a[1]<<8|a[2]:0}function L(a,c,b){return a in c?c[a]:b[a]}function sa(a,c,b){if(v&&Na){var


d=a.getContext("2d");ta=d.webkitBackingStorePixelRatio||d.mozBackingStorePixelRatio||d.
msBackingStorePixelRatio||d.oBackingStorePixelRatio||d.backingStorePixelRatio||1;Q=Aa/ta
;a.width=c*Q;a.height=b*Q;Aa!==ta&&(a.style.width=c+"px",a.style.height=b+"px",d.scale
(Q,Q))}else a.width=c,a.height=b}function Sa(a){if(!Ba){var
c=!1,b=!1;"undefined"===typeof ba.Chart.creditHref?(a.creditHref="",a.creditText=

""):(c=a.updateOption("creditText"),b=a.updateOption("creditHref"));if(a.creditHref&&a.cre
ditText){a._creditLink||(a._creditLink=document.createElement("a"),a._creditLink.setAttribu
te("class","canvasjs-chart-
credit"),a._creditLink.setAttribute("style","outline:none;margin:0px;position:absolute;right:2
px;top:"+(a.height-14)+"px;color:dimgrey;text-decoration:none;font-size:11px;font-family:
Calibri, Lucida Grande, Lucida Sans Unicode, Arial, sans-
serif"),a._creditLink.setAttribute("tabIndex",

-
1),a._creditLink.setAttribute("target","_blank"));if(0===a.renderCount||c||b)a._creditLink.set
Attribute("href",a.creditHref),a._creditLink.innerHTML=a.creditText;a._creditLink&&a.cred
itHref&&a.creditText?(a._creditLink.parentElement||a._canvasJSContainer.appendChild(a._c
reditLink),a._creditLink.style.top=a.height-
14+"px"):a._creditLink.parentElement&&a._canvasJSContainer.removeChild(a._creditLink)

86
Chatbot designing

}}}function fa(a,c){var
b=document.createElement("canvas");b.setAttribute("class","canvasjs-chart-canvas");

sa(b,a,c);v||"undefined"===typeof
G_vmlCanvasManager||G_vmlCanvasManager.initElement(b);return b}function
Ca(a,c,b){if(a&&c&&b){b=b+"."+c;var d="image/"+c;a=a.toDataURL(d);var
f=!1,g=document.createElement("a");g.download=b;g.href=a;g.target="_blank";if("undefined
"!==typeof Blob&&new Blob){for(var h=a.replace(/^data:[a-
z/]*;base64,/,""),h=atob(h),k=new ArrayBuffer(h.length),k=new
Uint8Array(k),l=0;l<h.length;l++)k[l]=h.charCodeAt(l);c=new
Blob([k.buffer],{type:"image/"+c});try{window.navigator.msSaveBlob(c,

b),f=!0}catch(m){g.dataset.downloadurl=[d,g.download,g.href].join(":"),g.href=window.UR
L.createObjectURL(c)}}if(!f)try{event=document.createEvent("MouseEvents"),event.initMo
useEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),g.dispatchEvent?g.dispatchEvent(
event):g.fireEvent&&g.fireEvent("onclick")}catch(n){c=window.open(),c.document.write("<
img src='"+a+"'></img><div>Please right click on the image and save it to your
device</div>"),c.document.close()}}}function T(a,c,b){c.getAttribute("state")!==

b&&(c.setAttribute("state",b),c.setAttribute("type","button"),c.style.position="relative",c.styl
e.margin="0px 0px 0px 0px",c.style.padding="3px 4px 0px
4px",c.style.cssFloat="left",c.setAttribute("title",a._cultureInfo[b+"Text"]),c.innerHTML="<i
mg style='height:16px;' src='"+Ta[b].image+"' alt='"+a._cultureInfo[b+"Text"]+"'
/>")}function ua(){for(var
a=null,c=0;c<arguments.length;c++)a=arguments[c],a.style&&(a.style.display="inline")}fun
ction Y(){for(var a=null,c=0;c<arguments.length;c++)(a=arguments[c])&&

a.style&&(a.style.display="none")}function
M(a,c,b,d){this._defaultsKey=a;this.parent=d;this._eventListeners=[];d={};b&&(ha[b]&&ha
[b][a])&&(d=ha[b][a]);this.options=c?c:{_isPlaceholder:!0};this.setOptions(this.options,d)}f
unction A(a,c){c=c||{};A.base.constructor.call(this,"Chart",c,c.theme?c.theme:"theme1");var
b=this;this._containerId=a;this._objectsInitialized=!1;this.overlaidCanvasCtx=this.ctx=null;th
is._indexLabels=[];this._panTimerId=0;this._lastTouchEventType="";this._lastTouchData=n
ull;this.isAnimating=

87
Chatbot designing

!1;this.renderCount=0;this.panEnabled=this.disableToolTip=this.animatedRender=!1;this._de
faultCursor="default";this.plotArea={canvas:null,ctx:null,x1:0,y1:0,x2:0,y2:0,width:0,height:
0};this._dataInRenderedOrder=[];if(this.container="string"===typeof
this._containerId?document.getElementById(this._containerId):this._containerId){this.contai
ner.innerHTML="";var
d=0,f=0,d=this.options.width?this.width:0<this.container.clientWidth?this.container.clientWi
dth:this.width,f=this.options.height?this.height:

0<this.container.clientHeight?this.container.clientHeight:this.height;this.width=d;this.height=
f;this.x1=this.y1=0;this.x2=this.width;this.y2=this.height;this._selectedColorSet="undefined"
!==typeof
ga[this.colorSet]?ga[this.colorSet]:ga.colorSet1;this._canvasJSContainer=document.createEle
ment("div");this._canvasJSContainer.setAttribute("class","canvasjs-chart-
container");this._canvasJSContainer.style.position="relative";this._canvasJSContainer.style.t
extAlign="left";this._canvasJSContainer.style.cursor=

"auto";v||(this._canvasJSContainer.style.height="0px");this.container.appendChild(this._canv
asJSContainer);this.canvas=fa(d,f);this.canvas.style.position="absolute";this.canvas.getConte
xt&&(this._canvasJSContainer.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d
"),this.ctx.textBaseline="top",Qa(this.ctx),v?this.plotArea.ctx=this.ctx:(this.plotArea.canvas=
fa(d,f),this.plotArea.canvas.style.position="absolute",this.plotArea.canvas.setAttribute("class
","plotAreaCanvas"),this._canvasJSContainer.appendChild(this.plotArea.canvas),

this.plotArea.ctx=this.plotArea.canvas.getContext("2d")),this.overlaidCanvas=fa(d,f),this.ove
rlaidCanvas.style.position="absolute",this._canvasJSContainer.appendChild(this.overlaidCan
vas),this.overlaidCanvasCtx=this.overlaidCanvas.getContext("2d"),this.overlaidCanvasCtx.te
xtBaseline="top",this._eventManager=new
ma(this),this.windowResizeHandler=K(window,"resize",function(){b._updateSize()&&b.ren
der()}),this._toolBar=document.createElement("div"),this._toolBar.setAttribute("class","canv
asjs-chart-toolbar"),

this._toolBar.style.cssText="position: absolute; right: 1px; top:


1px;",this._canvasJSContainer.appendChild(this._toolBar),this.bounds={x1:0,y1:0,x2:this.wi
dth,y2:this.height},K(this.overlaidCanvas,"click",function(a){b._mouseEventHandler(a)}),K(
this.overlaidCanvas,"mousemove",function(a){b._mouseEventHandler(a)}),K(this.overlaidC
anvas,"mouseup",function(a){b._mouseEventHandler(a)}),K(this.overlaidCanvas,"mousedo

88
Chatbot designing

wn",function(a){b._mouseEventHandler(a);Y(b._dropdownMenu)}),K(this.overlaidCanvas,"
mouseout",

function(a){b._mouseEventHandler(a)}),K(this.overlaidCanvas,window.navigator.msPointer
Enabled?"MSPointerDown":"touchstart",function(a){b._touchEventHandler(a)}),K(this.overl
aidCanvas,window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",function(a)
{b._touchEventHandler(a)}),K(this.overlaidCanvas,window.navigator.msPointerEnabled?"M
SPointerUp":"touchend",function(a){b._touchEventHandler(a)}),K(this.overlaidCanvas,wind
ow.navigator.msPointerEnabled?"MSPointerCancel":"touchcancel",function(a){b._touchEve
ntHandler(a)}),

this.toolTip=new
S(this,this.options.toolTip),this.data=null,this.axisX=[],this.axisX2=[],this.axisY=[],this.axis
Y2=[],this.sessionVariables={axisX:[],axisX2:[],axisY:[],axisY2:[]})}else
window.console&&window.console.log('CanvasJS Error: Chart Container with id
"'+this._containerId+'" was not found')}function va(a,c){for(var
b=[],d,f=0;f<a.length;f++)if(0==f)b.push(a[0]);else{var g,h,k;k=f-1;g=0===k?0:k-
1;h=k===a.length-1?k:k+1;d=Math.abs((a[h].x-a[g].x)/(0===a[h].x-a[k].x?0.01:a[h].x-
a[k].x))*(c-

1)/2+1;var l=(a[h].x-a[g].x)/d;d=(a[h].y-
a[g].y)/d;b[b.length]=a[k].x>a[g].x&&0<l||a[k].x<a[g].x&&0>l?{x:a[k].x+l/3,y:a[k].y+d/3}:
{x:a[k].x,y:a[k].y+d/9};k=f;g=0===k?0:k-1;h=k===a.length-1?k:k+1;d=Math.abs((a[h].x-
a[g].x)/(0===a[k].x-a[g].x?0.01:a[k].x-a[g].x))*(c-1)/2+1;l=(a[h].x-a[g].x)/d;d=(a[h].y-
a[g].y)/d;b[b.length]=a[k].x>a[g].x&&0<l||a[k].x<a[g].x&&0>l?{x:a[k].x-l/3,y:a[k].y-
d/3}:{x:a[k].x,y:a[k].y-d/9};b[b.length]=a[f]}return b}function
Oa(a,c){if(null===a||"undefined"===typeof a)return c;

var
b=parseFloat(a.toString())*(0<=a.toString().indexOf("%")?c/100:1);return!isNaN(b)&&b<=c
&&0<=b?b:c}function ia(a,c,b,d,f){"undefined"===typeof
f&&(f=0);this._padding=f;this._x1=a;this._y1=c;this._x2=b;this._y2=d;this._rightOccupied=
this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding}function
W(a,c){W.base.constructor.call(this,"TextBlock",c);this.ctx=a;this._isDirty=!0;this._wrapped
Text=null}function
na(a,c){na.base.constructor.call(this,"Title",c,a.theme,a);this.chart=a;this.canvas=

89
Chatbot designing

a.canvas;this.ctx=this.chart.ctx;this.optionsName="title";if(x(this.options.margin)&&a.option
s.subtitles)for(var
b=a.options.subtitles,d=0;d<b.length;d++)if((x(b[d].horizontalAlign)&&"center"===this.hori
zontalAlign||b[d].horizontalAlign===this.horizontalAlign)&&(x(b[d].verticalAlign)&&"top"
===this.verticalAlign||b[d].verticalAlign===this.verticalAlign)&&!b[d].dockInsidePlotArea=
==!this.dockInsidePlotArea){this.margin=0;break}"undefined"===typeof
this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));

this.height=this.width=null;this.bounds={x1:null,y1:null,x2:null,y2:null}}function
wa(a,c){wa.base.constructor.call(this,"Subtitle",c,a.theme,a);this.chart=a;this.canvas=a.canva
s;this.ctx=this.chart.ctx;this.optionsName="subtitles";this.isOptionsInArray=!0;"undefined"=
==typeof
this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.height=
this.width=null;this.bounds={x1:null,y1:null,x2:null,y2:null}}function
xa(a,c){xa.base.constructor.call(this,"Legend",c,a.theme,a);

this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.ghostCtx=this.chart._eventMana
ger.ghostCtx;this.items=[];this.optionsName="legend";this.height=this.width=0;this.orientati
on=null;this.dataSeries=[];this.bounds={x1:null,y1:null,x2:null,y2:null};"undefined"===type
of
this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.lineHei
ght=Ka(this.fontFamily,this.fontSize,this.fontWeight);this.horizontalSpacing=this.fontSize}f
unction Da(a,c){Da.base.constructor.call(this,

c);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx}function
$(a,c,b,d){$.base.constructor.call(this,"DataSeries",c,a.theme,a);this.chart=a;this.canvas=a.ca
nvas;this._ctx=a.canvas.ctx;this.index=b;this.noDataPointsInPlotArea=0;this.id=d;this.chart._
eventManager.objectMap[d]={id:d,objectType:"dataSeries",dataSeriesIndex:b};this.dataPoint
Ids=[];this.plotUnit=[];this.axisY=this.axisX=null;this.optionsName="data";this.isOptionsIn
Array=!0;null===this.fillOpacity&&(this.type.match(/area/i)?this.fillOpacity=

0.7:this.fillOpacity=1);this.axisPlacement=this.getDefaultAxisPlacement();"undefined"===ty
peof
this.options.indexLabelFontSize&&(this.indexLabelFontSize=this.chart.getAutoFontSize(thi
s.indexLabelFontSize))}function
B(a,c,b,d,f){B.base.constructor.call(this,"Axis",c,a.theme,a);this.chart=a;this.canvas=a.canva

90
Chatbot designing

s;this.ctx=a.ctx;this.intervalStartPosition=this.maxHeight=this.maxWidth=0;this.labels=[];thi
s.dataSeries=[];this._stripLineLabels=this._ticks=this._labels=null;this.dataInfo={min:Infinit
y,max:-Infinity,

viewPortMin:Infinity,viewPortMax:-
Infinity,minDiff:Infinity};this.isOptionsInArray=!0;"axisX"===b?("left"===d||"bottom"===d
?(this.optionsName="axisX",x(this.chart.sessionVariables.axisX[f])&&(this.chart.sessionVar
iables.axisX[f]={}),this.sessionVariables=this.chart.sessionVariables.axisX[f]):(this.optionsN
ame="axisX2",x(this.chart.sessionVariables.axisX2[f])&&(this.chart.sessionVariables.axisX
2[f]={}),this.sessionVariables=this.chart.sessionVariables.axisX2[f]),this.options.interval||(th
is.intervalType=

null),"theme2"===this.chart.theme&&x(this.options.lineThickness)&&(this.lineThickness=2
)):"left"===d||"top"===d?(this.optionsName="axisY",x(this.chart.sessionVariables.axisY[f])
&&(this.chart.sessionVariables.axisY[f]={}),this.sessionVariables=this.chart.sessionVariable
s.axisY[f]):(this.optionsName="axisY2",x(this.chart.sessionVariables.axisY2[f])&&(this.cha
rt.sessionVariables.axisY2[f]={}),this.sessionVariables=this.chart.sessionVariables.axisY2[f]
);"undefined"===typeof this.options.titleFontSize&&

(this.titleFontSize=this.chart.getAutoFontSize(this.titleFontSize));"undefined"===typeof
this.options.labelFontSize&&(this.labelFontSize=this.chart.getAutoFontSize(this.labelFontSi
ze));this.type=b;"axisX"!==b||c&&"undefined"!==typeof
c.gridThickness||(this.gridThickness=0);this._position=d;this.lineCoordinates={x1:null,y1:nul
l,x2:null,y2:null,width:null};this.labelAngle=(this.labelAngle%360+360)%360;90<this.label
Angle&&270>this.labelAngle?this.labelAngle-
=180:270<=this.labelAngle&&360>=this.labelAngle&&

(this.labelAngle-
=360);if(this.options.stripLines&&0<this.options.stripLines.length)for(this.stripLines=[],c=0;
c<this.options.stripLines.length;c++)this.stripLines.push(new
oa(this.chart,this.options.stripLines[c],a.theme,++this.chart._eventManager.lastObjectId,this)
);this._titleTextBlock=null;this.hasOptionChanged("viewportMinimum")&&null===this.vie
wportMinimum&&(this.options.viewportMinimum=void
0,this.sessionVariables.viewportMinimum=null);this.hasOptionChanged("viewportMinimum
")||isNaN(this.sessionVariables.newViewportMinimum)||

91
Chatbot designing

null===this.sessionVariables.newViewportMinimum?this.sessionVariables.newViewportMin
imum=null:this.viewportMinimum=this.sessionVariables.newViewportMinimum;this.hasOpt
ionChanged("viewportMaximum")&&null===this.viewportMaximum&&(this.options.viewp
ortMaximum=void
0,this.sessionVariables.viewportMaximum=null);this.hasOptionChanged("viewportMaximu
m")||isNaN(this.sessionVariables.newViewportMaximum)||null===this.sessionVariables.new
ViewportMaximum?this.sessionVariables.newViewportMaximum=null:this.viewportMaxim
um=

this.sessionVariables.newViewportMaximum;null!==this.minimum&&null!==this.viewport
Minimum&&(this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum));nul
l!==this.maximum&&null!==this.viewportMaximum&&(this.viewportMaximum=Math.min(
this.viewportMaximum,this.maximum));this.trackChanges("viewportMinimum");this.trackC
hanges("viewportMaximum")}function
oa(a,c,b,d,f){oa.base.constructor.call(this,"StripLine",c,b,f);this.id=d;this.chart=a;this.ctx=thi
s.chart.ctx;this.label=this.label;this.axis=f;

this.optionsName="stripLines";this.isOptionsInArray=!0;this._thicknessType="pixel";null!=
=this.startValue&&null!==this.endValue&&(this.value=f.logarithmic?Math.sqrt((this.startVa
lue.getTime?this.startValue.getTime():this.startValue)*(this.endValue.getTime?this.endValu
e.getTime():this.endValue)):((this.startValue.getTime?this.startValue.getTime():this.startVal
ue)+(this.endValue.getTime?this.endValue.getTime():this.endValue))/2,this.thickness=f.loga
rithmic?Math.log(this.endValue/this.startValue)/Math.log(f.logarithmBase):

Math.max(this.endValue-this.startValue),this._thicknessType="value")}function
S(a,c){S.base.constructor.call(this,"ToolTip",c,a.theme,a);this.chart=a;this.canvas=a.canvas;t
his.ctx=this.chart.ctx;this.currentDataPointIndex=this.currentSeriesIndex=-
1;this._timerId=0;this._prevY=this._prevX=NaN;this.optionsName="toolTip";this._initialize(
)}function
ma(a){this.chart=a;this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscri
ptions=[];this.previousDataPointEventObject=null;this.ghostCanvas=

fa(this.chart.width,this.chart.height);this.ghostCtx=this.ghostCanvas.getContext("2d");this.m
ouseoveredObjectMaps=[]}function pa(a){var
c;a&&qa[a]&&(c=qa[a]);pa.base.constructor.call(this,"CultureInfo",c)}function
Ea(a){this.chart=a;this.ctx=this.chart.plotArea.ctx;this.animations=[];this.animationRequestI

92
Chatbot designing

d=null}var
z={},v=!!document.createElement("canvas").getContext,ba={Chart:{width:500,height:400,z
oomEnabled:!1,zoomType:"x",backgroundColor:"white",theme:"theme1",animationEnabled:
!1,animationDuration:1200,

dataPointWidth:null,dataPointMinWidth:null,dataPointMaxWidth:null,colorSet:"colorSet1",c
ulture:"en",creditHref:"",creditText:"CanvasJS",interactivityEnabled:!0,exportEnabled:!1,exp
ortFileName:"Chart",rangeChanging:null,rangeChanged:null,publicProperties:{title:"readWri
te",subtitles:"readWrite",toolTip:"readWrite",legend:"readWrite",axisX:"readWrite",axisY:"r
eadWrite",axisX2:"readWrite",axisY2:"readWrite",data:"readWrite",options:"readWrite",bou
nds:"readOnly",container:"readOnly"}},Title:{padding:0,

text:null,verticalAlign:"top",horizontalAlign:"center",fontSize:20,fontFamily:"Calibri",fontW
eight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",
cornerRadius:0,backgroundColor:v?"transparent":null,margin:5,wrap:!0,maxWidth:null,dock
InsidePlotArea:!1,publicProperties:{options:"readWrite",bounds:"readOnly",chart:"readOnly
"}},Subtitle:{padding:0,text:null,verticalAlign:"top",horizontalAlign:"center",fontSize:14,fon
tFamily:"Calibri",fontWeight:"normal",fontColor:"black",

fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:
null,margin:2,wrap:!0,maxWidth:null,dockInsidePlotArea:!1,publicProperties:{options:"read
Write",bounds:"readOnly",chart:"readOnly"}},Legend:{name:null,verticalAlign:"center",hori
zontalAlign:"right",fontSize:14,fontFamily:"calibri",fontWeight:"normal",fontColor:"black",
fontStyle:"normal",cursor:null,itemmouseover:null,itemmouseout:null,itemmousemove:null,i
temclick:null,dockInsidePlotArea:!1,reversed:!1,backgroundColor:v?

"transparent":null,borderColor:v?"transparent":null,borderThickness:0,cornerRadius:0,maxW
idth:null,maxHeight:null,markerMargin:null,itemMaxWidth:null,itemWidth:null,itemWrap:!
0,itemTextFormatter:null,publicProperties:{options:"readWrite",bounds:"readOnly",chart:"re
adOnly"}},ToolTip:{enabled:!0,shared:!1,animationEnabled:!0,content:null,contentFormatter
:null,reversed:!1,backgroundColor:v?"rgba(255,255,255,.9)":"rgb(255,255,255)",borderColor
:null,borderThickness:2,cornerRadius:5,fontSize:14,fontColor:"black",

fontFamily:"Calibri, Arial, Georgia,


serif;",fontWeight:"normal",fontStyle:"italic",publicProperties:{options:"readWrite",chart:"re
adOnly"}},Axis:{minimum:null,maximum:null,viewportMinimum:null,viewportMaximum:n

93
Chatbot designing

ull,interval:null,intervalType:null,reversed:!1,logarithmic:!1,logarithmBase:10,title:null,titleF
ontColor:"black",titleFontSize:20,titleFontFamily:"arial",titleFontWeight:"normal",titleFontS
tyle:"normal",titleWrap:!0,titleMaxWidth:null,titleBackgroundColor:v?"transparent":null,titl
eBorderColor:v?

"transparent":null,titleBorderThickness:0,titleCornerRadius:0,labelAngle:0,labelFontFamily:"
arial",labelFontColor:"black",labelFontSize:12,labelFontWeight:"normal",labelFontStyle:"no
rmal",labelAutoFit:!0,labelWrap:!0,labelMaxWidth:null,labelFormatter:null,labelBackground
Color:v?"transparent":null,labelBorderColor:v?"transparent":null,labelBorderThickness:0,lab
elCornerRadius:0,prefix:"",suffix:"",includeZero:!0,tickLength:5,tickColor:"black",tickThick
ness:1,lineColor:"black",lineThickness:1,lineDashType:"solid",

gridColor:"A0A0A0",gridThickness:0,gridDashType:"solid",interlacedColor:v?"transparent":
null,valueFormatString:null,margin:2,stripLines:[],publicProperties:{options:"readWrite",bou
nds:"readOnly",chart:"readOnly"}},StripLine:{value:null,startValue:null,endValue:null,color
:"orange",opacity:null,thickness:2,lineDashType:"solid",label:"",labelPlacement:"inside",labe
lAlign:"far",labelWrap:!0,labelMaxWidth:null,labelBackgroundColor:v?"transparent":null,la
belBorderColor:v?"transparent":null,labelBorderThickness:0,

labelCornerRadius:0,labelFontFamily:"arial",labelFontColor:"orange",labelFontSize:12,label
FontWeight:"normal",labelFontStyle:"normal",labelFormatter:null,showOnTop:!1,publicPro
perties:{options:"readWrite",axis:"readOnly",bounds:"readOnly",chart:"readOnly"}},DataSer
ies:{name:null,dataPoints:null,label:"",bevelEnabled:!1,highlightEnabled:!0,cursor:"default",i
ndexLabel:"",indexLabelPlacement:"auto",indexLabelOrientation:"horizontal",indexLabelFo
ntColor:"black",indexLabelFontSize:12,indexLabelFontStyle:"normal",

indexLabelFontFamily:"Arial",indexLabelFontWeight:"normal",indexLabelBackgroundColo
r:null,indexLabelLineColor:"gray",indexLabelLineThickness:1,indexLabelLineDashType:"so
lid",indexLabelMaxWidth:null,indexLabelWrap:!0,indexLabelFormatter:null,lineThickness:2
,lineDashType:"solid",connectNullData:!1,nullDataLineDashType:"dash",color:null,lineColo
r:null,risingColor:"white",fillOpacity:null,startAngle:0,radius:null,innerRadius:null,type:"col
umn",xValueType:"number",axisXType:"primary",axisYType:"primary",

axisXIndex:0,axisYIndex:0,xValueFormatString:null,yValueFormatString:null,zValueFormat
String:null,percentFormatString:null,showInLegend:null,legendMarkerType:null,legendMark
erColor:null,legendText:null,legendMarkerBorderColor:v?"transparent":null,legendMarkerB

94
Chatbot designing

orderThickness:0,markerType:"circle",markerColor:null,markerSize:null,markerBorderColor
:v?"transparent":null,markerBorderThickness:0,mouseover:null,mouseout:null,mousemove:n
ull,click:null,toolTipContent:null,visible:!0,publicProperties:{options:"readWrite",

axisX:"readWrite",axisY:"readWrite",chart:"readOnly"}},TextBlock:{x:0,y:0,width:null,heig
ht:null,maxWidth:null,maxHeight:null,padding:0,angle:0,text:"",horizontalAlign:"center",fon
tSize:12,fontFamily:"calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",bor
derThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,textBaseline:"top"
},CultureInfo:{decimalSeparator:".",digitGroupSeparator:",",zoomText:"Zoom",panText:"Pa
n",resetText:"Reset",menuText:"More Options",saveJPGText:"Save as JPEG",

savePNGText:"Save as PNG",printText:"Print",days:"Sunday Monday Tuesday Wednesday


Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split("
"),months:"January February March April May June July August September October
November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct
Nov Dec".split(" ")}},qa={en:{}},ga={colorSet1:"#369EAD #C24642 #7F6084 #86B402
#A2D1CF #C8B631 #6DBCEB #52514E #4F81BC #A064A1 #F79647".split("
"),colorSet2:"#4F81BC #C0504E #9BBB58 #23BFAA #8064A1 #4AACC5 #F79647
#33558B".split(" "),

colorSet3:"#8CA1BC #36845C #017E82 #8CB9D0 #708C98 #94838D #F08891 #0366A7


#008276 #EE7757 #E5BA3A #F2990B #03557B #782970".split("
")},ha={theme1:{Chart:{colorSet:"colorSet1"},Title:{fontFamily:v?"Calibri, Optima,
Candara, Verdana, Geneva, sans-
serif":"calibri",fontSize:33,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",mar
gin:5},Subtitle:{fontFamily:v?"Calibri, Optima, Candara, Verdana, Geneva, sans-
serif":"calibri",fontSize:16,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",

margin:5},Axis:{titleFontSize:26,titleFontColor:"#666666",titleFontFamily:v?"Calibri,
Optima, Candara, Verdana, Geneva, sans-serif":"calibri",labelFontFamily:v?"Calibri,
Optima, Candara, Verdana, Geneva, sans-
serif":"calibri",labelFontSize:18,labelFontColor:"grey",tickColor:"#BBBBBB",tickThickness
:2,gridThickness:2,gridColor:"#BBBBBB",lineThickness:2,lineColor:"#BBBBBB"},Legend:
{verticalAlign:"bottom",horizontalAlign:"center",fontFamily:v?"monospace, sans-serif,arial
black":"calibri"},DataSeries:{indexLabelFontColor:"grey",

95
Chatbot designing

indexLabelFontFamily:v?"Calibri, Optima, Candara, Verdana, Geneva, sans-


serif":"calibri",indexLabelFontSize:18,indexLabelLineThickness:1}},theme2:{Chart:{colorS
et:"colorSet2"},Title:{fontFamily:"impact, charcoal, arial black, sans-
serif",fontSize:32,fontColor:"#333333",verticalAlign:"top",margin:5},Subtitle:{fontFamily:"i
mpact, charcoal, arial black, sans-
serif",fontSize:14,fontColor:"#333333",verticalAlign:"top",margin:5},Axis:{titleFontSize:22,
titleFontColor:"rgb(98,98,98)",titleFontFamily:v?"monospace, sans-serif,arial black":

"arial",titleFontWeight:"bold",labelFontFamily:v?"monospace, Courier New,


Courier":"arial",labelFontSize:16,labelFontColor:"grey",labelFontWeight:"bold",tickColor:"g
rey",tickThickness:2,gridThickness:2,gridColor:"grey",lineColor:"grey",lineThickness:0},Le
gend:{verticalAlign:"bottom",horizontalAlign:"center",fontFamily:v?"monospace, sans-
serif,arial
black":"arial"},DataSeries:{indexLabelFontColor:"grey",indexLabelFontFamily:v?"Courier
New, Courier, monospace":"arial",indexLabelFontWeight:"bold",indexLabelFontSize:18,

indexLabelLineThickness:1}},theme3:{Chart:{colorSet:"colorSet1"},Title:{fontFamily:v?"C
andara, Optima, Trebuchet MS, Helvetica Neue, Helvetica, Trebuchet MS,
serif":"calibri",fontSize:32,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",mar
gin:5},Subtitle:{fontFamily:v?"Candara, Optima, Trebuchet MS, Helvetica Neue, Helvetica,
Trebuchet MS,
serif":"calibri",fontSize:16,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",mar
gin:5},Axis:{titleFontSize:22,titleFontColor:"rgb(98,98,98)",

titleFontFamily:v?"Verdana, Geneva, Calibri, sans-


serif":"calibri",labelFontFamily:v?"Calibri, Optima, Candara, Verdana, Geneva, sans-
serif":"calibri",labelFontSize:18,labelFontColor:"grey",tickColor:"grey",tickThickness:2,grid
Thickness:2,gridColor:"grey",lineThickness:2,lineColor:"grey"},Legend:{verticalAlign:"bott
om",horizontalAlign:"center",fontFamily:v?"monospace, sans-serif,arial
black":"calibri"},DataSeries:{bevelEnabled:!0,indexLabelFontColor:"grey",indexLabelFontF
amily:v?"Candara, Optima, Calibri, Verdana, Geneva, sans-serif":

"calibri",indexLabelFontSize:18,indexLabelLineColor:"lightgrey",indexLabelLineThickness:
2}}},E={numberDuration:1,yearDuration:314496E5,monthDuration:2592E6,weekDuration:6
048E5,dayDuration:864E5,hourDuration:36E5,minuteDuration:6E4,secondDuration:1E3,mill
isecondDuration:1,dayOfWeekFromInt:"Sunday Monday Tuesday Wednesday Thursday

96
Chatbot designing

Friday Saturday".split(" ")},La={},aa=null,Fa=function(){var


a=/D{1,4}|M{1,4}|Y{1,4}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|f{1,3}|t{1,2}|T{1,2}|K|z{1,3}|"[^"]*
"|'[^']*'/g,c="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),

b="Sun Mon Tue Wed Thu Fri Sat".split(" "),d="January February March April May June
July August September October November December".split(" "),f="Jan Feb Mar Apr May
Jun Jul Aug Sep Oct Nov Dec".split("
"),g=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic)
(?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,h=/[^-+\dA-
Z]/g;return function(k,l,m){var
n=m?m.days:c,p=m?m.months:d,e=m?m.shortDays:b,r=m?m.shortMonths:f;m="";var
q=!1;k=k&&k.getTime?k:k?new Date(k):new Date;

if(isNaN(k))throw SyntaxError("invalid
date");"UTC:"===l.slice(0,4)&&(l=l.slice(4),q=!0);m=q?"getUTC":"get";var
s=k[m+"Date"](),u=k[m+"Day"](),w=k[m+"Month"](),y=k[m+"FullYear"](),t=k[m+"Hours"
](),v=k[m+"Minutes"](),Z=k[m+"Seconds"](),ja=k[m+"Milliseconds"](),x=q?0:k.getTimezon
eOffset();return m=l.replace(a,function(a){switch(a){case "D":return s;case "DD":return
O(s,2);case "DDD":return e[u];case "DDDD":return n[u];case "M":return w+1;case
"MM":return O(w+1,2);case "MMM":return r[w];case "MMMM":return p[w];

case "Y":return parseInt(String(y).slice(-2));case "YY":return O(String(y).slice(-2),2);case


"YYY":return O(String(y).slice(-3),3);case "YYYY":return O(y,4);case "h":return
t%12||12;case "hh":return O(t%12||12,2);case "H":return t;case "HH":return O(t,2);case
"m":return v;case "mm":return O(v,2);case "s":return Z;case "ss":return O(Z,2);case
"f":return String(ja).slice(0,1);case "ff":return O(String(ja).slice(0,2),2);case "fff":return
O(String(ja).slice(0,3),3);case "t":return 12>t?"a":"p";case "tt":return 12>

t?"am":"pm";case "T":return 12>t?"A":"P";case "TT":return 12>t?"AM":"PM";case


"K":return q?"UTC":(String(k).match(g)||[""]).pop().replace(h,"");case "z":return(0<x?"-
":"+")+Math.floor(Math.abs(x)/60);case "zz":return(0<x?"-
":"+")+O(Math.floor(Math.abs(x)/60),2);case "zzz":return(0<x?"-
":"+")+O(Math.floor(Math.abs(x)/60),2)+O(Math.abs(x)%60,2);default:return
a.slice(1,a.length-1)}})}}(),ca=function(a,c,b){if(null===a)return"";a=Number(a);var
d=0>a?!0:!1;d&&(a*=-1);var f=b?b.decimalSeparator:".",g=

97
Chatbot designing

b?b.digitGroupSeparator:",",h="";c=String(c);var h=1,k=b="",l=-
1,m=[],n=[],p=0,e=0,r=0,q=!1,s=0,k=c.match(/"[^"]*"|'[^']*'|[eE][+-
]*[0]+|[,]+[.]|\u2030|./g);c=null;for(var
u=0;k&&u<k.length;u++)if(c=k[u],"."===c&&0>l)l=u;else{if("%"===c)h*=100;else
if("\u2030"===c){h*=1E3;continue}else if(","===c[0]&&"."===c[c.length-
1]){h/=Math.pow(1E3,c.length-1);l=u+c.length-
1;continue}else"E"!==c[0]&&"e"!==c[0]||"0"!==c[c.length-
1]||(q=!0);0>l?(m.push(c),"#"===c||"0"===c?p++:","===c&&r++):(n.push(c),"#"!==c&&

"0"!==c||e++)}q&&(c=Math.floor(a),k=-
Math.floor(Math.log(a)/Math.LN10+1),s=0===a?0:0===c?-(p+k):String(c).length-
p,h/=Math.pow(10,s));0>l&&(l=u);h=(a*h).toFixed(e);c=h.split(".");h=(c[0]+"").split("");a=(
c[1]+"").split("");h&&"0"===h[0]&&h.shift();for(q=k=u=e=l=0;0<m.length;)if(c=m.pop(),"
#"===c||"0"===c)if(l++,l===p){var w=h,h=[];if("0"===c)for(c=p-e-
(w?w.length:0);0<c;)w.unshift("0"),c--
;for(;0<w.length;)b=w.pop()+b,q++,0===q%k&&(u===r&&0<w.length)&&(b=g+b)}else
0<h.length?(b=h.pop()+b,e++,q++):

"0"===c&&(b="0"+b,e++,q++),0===q%k&&(u===r&&0<h.length)&&(b=g+b);else"E"!==
c[0]&&"e"!==c[0]||"0"!==c[c.length-1]||!/[eE][+-
]*[0]+/.test(c)?","===c?(u++,k=q,q=0,0<h.length&&(b=g+b)):b=1<c.length&&('"'===c[0]&
&'"'===c[c.length-1]||"'"===c[0]&&"'"===c[c.length-1])?c.slice(1,c.length-
1)+b:c+b:(c=0>s?c.replace("+","").replace("-",""):c.replace("-
",""),b+=c.replace(/[0]+/,function(a){return
O(s,a.length)}));g="";for(m=!1;0<n.length;)c=n.shift(),"#"===c||"0"===c?0<a.length&&0!=
=Number(a.join(""))?(g+=a.shift(),

m=!0):"0"===c&&(g+="0",m=!0):1<c.length&&('"'===c[0]&&'"'===c[c.length-
1]||"'"===c[0]&&"'"===c[c.length-1])?g+=c.slice(1,c.length-
1):"E"!==c[0]&&"e"!==c[0]||"0"!==c[c.length-1]||!/[eE][+-
]*[0]+/.test(c)?g+=c:(c=0>s?c.replace("+","").replace("-",""):c.replace("-
",""),g+=c.replace(/[0]+/,function(a){return O(s,a.length)}));b+=(m?f:"")+g;return d?"-
"+b:b},ya=function(a){var
c=0,b=0;a=a||window.event;a.offsetX||0===a.offsetX?(c=a.offsetX,b=a.offsetY):a.layerX||0=
=a.layerX?(c=a.layerX,b=a.layerY):(c=a.pageX-

98
Chatbot designing

a.target.offsetLeft,b=a.pageY-
a.target.offsetTop);return{x:c,y:b}},Na=!0,Aa=window.devicePixelRatio||1,ta=1,Q=Na?Aa/t
a:1,Ba=window&&window.location&&window.location.href&&window.location.href.index
Of&&(-1!==window.location.href.indexOf("")||-
1!==window.location.href.indexOf("fenopix.com")||-
1!==window.location.href.indexOf("fiddle")),Ta={reset:{image:"data:image/png;base64,iVB
ORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAABHNCSVQICAgIf
AhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmU
gRmlyZXdvcmtzIENTNui8sowAAAKRSURBVEiJrdY/iF1FFMfxzwnZrGISUSR/JLGIhoh/
QiRNBLWxMLIWEkwbgiAoFgoW2mhlY6dgpY2IlRBRxBSKhSAKIklWJRYuMZKAhiyo
pAiaTY7FvRtmZ+/ed9/zHRjezLw5v/O9d86cuZGZpmURAfdn5o9DfdZNLXpjz+LziPgyIl6
MiG0jPTJzZBuyDrP4BVm0P/AKbljTb4ToY/gGewYA7KyCl+1b3DUYANvwbiHw0gCAG
RzBOzjTAXEOu0cC4Ch+r5x/HrpdrcZmvIDFSucMtnYCYC++6HmNDw8FKDT34ETrf63
9/azOr5vwRk/g5fbeuABtgC04XWk9VQLciMP4EH/3AFzErRNC7MXlQmsesSoHsGPE23h
mEoBW+61K66HMXFmIMvN8myilXS36R01ub+KfYvw43ZXwYDX+AHP4BAci4pFJom
fmr/ihmNofESsBImJGk7mlncrM45n5JPbhz0kAWpsv+juxaX21YIPmVJS2uNzJMS6ZNexC
0d+I7fUWXLFyz2kSZlpWPvASlmqAf/FXNXf3FAF2F/1LuFifAlionB6dRuSI2IwHi6lzmX
mp6xR8XY0fiIh7psAwh+3FuDkRHQVjl+a8lkXjo0kLUKH7XaV5oO86PmZ1FTzyP4K/X
Gl9v/zwfbW7BriiuETGCP5ch9bc9f97HF/vcFzCa5gdEPgWq+t/4v0V63oE1uF4h0DiFJ7Hn
SWMppDdh1dxtsPvJ2wcBNAKbsJXa0Ck5opdaBPsRNu/usba09i1KsaAVzmLt3sghrRjuK1
Tf4xkegInxwy8gKf7dKMVH2QRsV5zXR/Cftyu+aKaKbbkQrsdH+PTzLzcqzkOQAVzM+7
FHdiqqe2/YT4zF/t8S/sPmawyvC974vcAAAAASUVORK5CYII="},

pan:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCA
YAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAA
Bx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAJVSURBVFiF
vZe7a1RBGMV/x2hWI4JpfKCIiSBKOoOCkID/wP4BFqIIFkE02ChIiC8QDKlSiI3YqRBsB
VGwUNAUdiIEUgjiAzQIIsuKJsfizsXr5t7d+8jmwLDfzHz3nLOzc7+ZxTZlGyDgZiWOCuJ
9wH2gCUyuqQFgF/AGcKJNrYkBYBj40CIet+muGQi/96kM4WS7C/Tm5VUg7whJg8BkE
GkCR4BDYfodsADUgP6wErO5iCtswsuJb32hdbXy8qzL5TIdmzJinHdZoZIBZcSFkGlAKs
1Z3YCketZcBtouuaQNkrblMiBpBrhme7mAgU4wMCvpcFsDkq4C54DFVRTH9h+i6vlE0r
5UA5ImgCuh28jB28iIs7BIVCOeStoZD64P4uPAjUTygKSx2FsK2TIwkugfk9Qkfd/E+yM
WHQCeSRqx/R3gOp3LazfaS2C4B5gHDgD7U9x3E3uAH7KNpC3AHHAwTL4FHgM9GQ
8vAaPA0dB/Abxqk2/gBLA9MXba9r1k/d4LfA3JtwueBeM58ucS+edXnAW23wP10N3advE

99
Chatbot designing

i9CXizTnyN4bPS7Zn4sH/dq3t18AY4e1YLYSy3g/csj2VnFshZPuOpOeSKHCodUINuGj7Y
etE6je1PV9QoNPJ9StNHKodx7nRbiWrGHBGXAi5DUiqtQwtpcWK0Jubt8CltA5MEV1Ifw
O7+VffPwGfia5m34CT4bXujIIX0Qna1/cGMNqV/wUJE2czxD8CQ4X5Sl7Jz7SILwCDpbj
KPBRMHAd+EtX4HWV5Spdc2w8kDQGPbH8py/MXMygM69/FKz4AAAAASUVORK5
CYII="},

zoom:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgC
AYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK6wAACusBgosNWgA
AABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAMqSURB
VFiFvdfbj91TFMDxz57U6GUEMS1aYzyMtCSSDhWjCZMInpAI3khE/QHtgzdRkXgSCS8
SES9epKLi0oRKNETjRahREq2KS1stdRujtDPtbA97n5zdn9+5zJxTK9k5v3POXmt991p7r7
1+IcaoGwkhTOIebMRqzOBTvIG3Y4zTXRmqSoyx5cAKbMJOHMFJnMZ8/jyFaXyMR7G
6nb1aH22cP4BvcBxziG3GKfyTIR9D6BYg1KUghPBCDveFlb/24Av8iuUYw41YVsz5G7u
xKcZ4aMEpwGt5NY3V/YbHsQ6rcAHOw/kYxigewr5CZw4fYGxBKcCLOFEYehXrMdRh
r5yLETxVScsOLOkKAPfn1TYMPIvLFrShUlS2FDZm8XRHACzFAWl3R2xbqPMCYhme
LCAOYEMngAczbcTvuHYxzguIy/FesR9e6gSwU/OoPYHBHgHgviIKX2Flq7k34KhmcVn
bi/PC8JX4MgMcxb118wZwdz5aISscqx7VRcox7MrPQ7i+btIAJrAkf9+bI9EPmZY2IAxiTS
uAldLq4Y9+AcSUh78KP0tbAcwU35cXMD1JCIFUoGiehlqAz6TNB1f1C0DK+0h+nsNPr
QC2a4bqGmlD9kOGcWt+Po6pVgDvSxfJaSkFd4UQBvoAsBYbCoB3a2flM7slA0R8iyt6rA
FDeDPbm8eOTpVwGD9qVq7nLbIaZnmksPU1JtsCZMXNmpdRxFasWITzh6Xj3LCzra1O
xcD2QjHiGVzdpfORnMqZio2PcF23ABdJF1Np4BPptlyPi6WzPYBzpJZtHe7A6xW9cnyP8
TqA//SEIYRL8Bxul7rihvwgtVn78WcGGZXa9HGd5TDujDHuOePXNiHdKjWgZX/YbsxL
x/ktqbjVzTlcjUSnvI5JrdlUVp6WesZZ6R1hRrpq9+EVTGS9jTjYAuKIouGpbcurEkIYxC05
1KNSamazsc+xK8b4S0VnEi/j0hqTP+M27O258egQwZuzs7pI7Mf4WQXIEDc5s9sux+5+1
Py2EmP8UOq6GvWhIScxfdYjUERiAt9Jd84J6a16zf8JEKT3yCm8g1UxRv8CC4pyRhzR1u
UAAAAASUVORK5CYII="},

menu:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAgC
AYAAAAbifjMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK6wAACusBgosNWg
AAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEV
YdENyZWF0aW9uIFRpbWUAMDcvMTUvMTTPsvU0AAAAP0lEQVRIie2SMQoAIBDD
UvH/X667g8sJJ9KOhYYOkW0qGaU1MPdC0vGSbV19EACo3YMPAFH5BUBUjsqfAPp
VXtNgGDfxEDCtAAAAAElFTkSuQmCC"}};(function(){z.fSDec=function(a){for(var
c="",b=0;b<a.length;b++)c+=String.fromCharCode(a[b]-111);return
c};z.str={tv:[],fntStr:[223,231,143,178,208,219,216,209,225,216,155,143,187,228,210,216,2

100
Chatbot designing

11,208,143,182,225,208,221,211,212,155,143,187,228,210,216,211,208,143,194,208,221,22
6,143,196,221,216,210,222,211,212,155,143,176,225,216,208,219,155,143,226,208,221,226,
156,226,212,225,216,213],tBl:[227,212,231,227,177,208,226,212,219,216,221,212],fnt:[213,
222,221,227],fSy:[213,216,219,219,194,227,232,219,212],fTx:[213,216,219,219,195,212,23
1,227],gr:[214,225,212,232],ct:[210,227,231],tp:[227,222,223]};delete ba[z.fSDec([178,

215,208,225,227])][z.fSDec([210,225,212,211,216,227,183,225,212,213])];z.pro={sCH:ba[z.
fSDec([178,215,208,225,227])][z.fSDec([210,225,212,211,216,227,183,225,212,213])]};z.f
AWm=function(a){if("undefined"===typeof z.pro.sCH&&!Ba){var
c=a[z.fSDec(z.str.ct)];c[z.fSDec(z.str.tBl)]=z.fSDec(z.str.tp);c[z.fSDec(z.str.fnt)]=11+z.fSDe
c(z.str.fntStr);c[z.fSDec(z.str.fSy)]=z.fSDec(z.str.gr);c[z.fSDec(z.str.fTx)](z.fSDec(z.str.tv),2
,a.height-11-2)}}})();(function(){z.ckDec=function(a){for(var c="",b=0;b<a.length;b++)c+=

String.fromCharCode(a[b]-111);return
c};z.str.ckn=[206,206,210,230,217,198,226,195,225];z.str.tem=[195,225,216,208,219,143,19
1,212,225,216,222,211,143,215,208,226,143,180,231,223,216,225,212,211,144];z.str.ctm=[1
91,219,212,208,226,212,143,210,222,221,227,208,210,227,143,226,208,219,212,226,175,21
0,208,221,229,208,226,217,226,157,210,222,220];z.str.ltm=[213,222,225,143,219,216,210,2
12,221,226,212,143,222,225,143,227,225,216,208,219,143,212,231,227,212,221,227,216,22
2,221];z.str.ckve=[212,231,223,216,

225,212,226,172];z.str.mco=[225,214,209,208,151,161,164,164,155,161,164,164,155,161,16
4,164,155,159,157,164,152];z.str.mcw=[198,215,216,227,212];z.str.mct=[225,214,209,208,1
51,161,162,160,155,161,168,155,164,163,155,159,157,166,152];z.str.mcr=[193,212,211];z.st
r.sk=[226,212,225,216,208,219,186,212,232];z.fNg=function(a){if(!Ba)try{var c;a:{var
b=RegExp(z.ckDec(z.str.ckn)+"=.*","gi"),d=new
Date,f=document.cookie.match(b),g=localStorage&&localStorage.getItem("lclStg")&&JSO
N.parse(localStorage.getItem("lclStg")).name.match(z.ckDec(z.str.ckn))?

JSON.parse(localStorage.getItem("lclStg")):null;if(f&&0<f.length||g){var
h,b=[],k=[],l=null;if(f)for(var m=f[0].split(";
"),f=0;f<m.length;f++)b.push(m[f].split("=")[0]),k.push(m[f].split("=")[1]);g&&(l=g);h={ck
Val:Number(k[0]),lSVal:l?Number(l.val):null};g=null;h&&h.ckVal&&h.lSVal?g=Math.min(
h.ckVal,h.lSVal):h&&h.ckVal?g=h.ckVal:h&&h.lSVal&&(g=h.lSVal);var
n=Math.round(Math.abs(g-d.getTime())),p;if(!x(ka[z.ckDec(z.str.sk)])&&"string"===typeof
ka[z.ckDec(z.str.sk)]&&ka[z.ckDec(z.str.sk)]){var e=ka[z.ckDec(z.str.sk)],

101
Chatbot designing

d=[];h=[];for(var m=0,b=f="",r=e.substr(e.length-3,e.length),k=0;k<e.length-
3;k++)d.push(parseInt(e.charCodeAt(k))-
59),f+=String.fromCharCode(d[k]),m+=parseInt(parseInt(f.charCodeAt(k))+59,10);m%=256
;m=99<m?""+m:9<m?"0"+m:"00"+m;for(k=0;k<r.length;k++)h.push(parseInt(r.charCodeAt(
k))-59),b+=String.fromCharCode(h[k]);p=m===b?f:0}else p=0;var q=p?(new
Date(Number(p))).getTime()-g:5184E6;if(isNaN(q)||n>q){c=!0;break a}}else{k=new
Date;l=k.getTime();k.setTime(l+31536E6);var s={name:z.ckDec(z.str.ckn),

val:(new Date).getTime()};document.cookie=z.ckDec(z.str.ckn)+"="+(new
Date).getTime()+"; "+z.ckDec(z.str.ckve)+k.toUTCString()+";
path=/;";localStorage.setItem("lclStg",JSON.stringify(s))}c=!1}if(c){c=20;var
u=a.plotArea.ctx;u.font="bold "+c+(v?"px Calibri, Lucida Grande, Lucida Sans Unicode,
Arial, sans-serif":"px Lucida Sans Unicode");var
w=z.ckDec(z.str.tem),y=u.measureText(w).width;u.fillStyle=v?z.ckDec(z.str.mco):z.ckDec(z
.str.mcw);u.fillRect(a.plotArea.x2-y-8,a.plotArea.y2-2.5*c-8,y+4,2.5*c+

8);u.fillStyle=v?z.ckDec(z.str.mct):z.ckDec(z.str.mcr);u.textBaseline="top";u.fillText(w,a.plo
tArea.x2-y-4,a.plotArea.y2-2.5*c-2);c=14;u.font=c+(v?"px Calibri, Lucida Grande, Lucida
Sans Unicode, Arial, sans-serif":"px Lucida Sans
Unicode");w=z.ckDec(z.str.ctm);y=u.measureText(w).width;u.fillStyle=v?z.ckDec(z.str.mct)
:z.ckDec(z.str.mcr);u.fillText(w,a.plotArea.x2-y-4,a.plotArea.y2-2*c-
4);w=z.ckDec(z.str.ltm);y=u.measureText(w).width;u.fillText(w,a.plotArea.x2-y-
4,a.plotArea.y2-c-4)}}catch(t){}}})();

M.prototype.setOptions=function(a,c){if(ba[this._defaultsKey]){var
b=ba[this._defaultsKey],d;for(d in
b)"publicProperties"!==d&&b.hasOwnProperty(d)&&(this[d]=a&&d in a?a[d]:c&&d in
c?c[d]:b[d])}};M.prototype.get=function(a){var
c=ba[this._defaultsKey];if("options"===a)return
this.options&&this.options._isPlaceholder?null:this.options;if(c.hasOwnProperty(a)||c.public
Properties&&c.publicProperties.hasOwnProperty(a))return
this[a];window.console&&window.console.log('Property "'+a+"\" doesn't exist. Please check
for typo.")};

M.prototype.set=function(a,c,b){b="undefined"===typeof b?!0:b;var
d=ba[this._defaultsKey];if("options"===a)this.createUserOptions(c);else

102
Chatbot designing

if(d.hasOwnProperty(a)||d.publicProperties&&d.publicProperties.hasOwnProperty(a)&&"rea
dWrite"===d.publicProperties[a])this.options._isPlaceholder&&this.createUserOptions(),this
.options[a]=c;else{window.console&&(d.publicProperties&&d.publicProperties.hasOwnPro
perty(a)&&"readOnly"===d.publicProperties[a]?window.console.log('Property "'+a+'" is
read-only.'):window.console.log('Property "'+

a+"\" doesn't exist. Please check for


typo."));return}b&&(chart=this.chart||this,chart.render())};M.prototype.addTo=function(a,c,b
,d){d="undefined"===typeof d?!0:d;var
f=ba[this._defaultsKey];f.hasOwnProperty(a)||f.publicProperties&&f.publicProperties.hasOw
nProperty(a)&&"readWrite"===f.publicProperties[a]?(this.options._isPlaceholder&&this.cre
ateUserOptions(),"undefined"===typeof
this.options[a]&&(this.options[a]=[]),a=this.options[a],b="undefined"===typeof
b||null===b?a.length:b,a.splice(b,0,c),

d&&(chart=this.chart||this,chart.render())):window.console&&(f.publicProperties&&f.public
Properties.hasOwnProperty(a)&&"readOnly"===f.publicProperties[a]?window.console.log('
Property "'+a+'" is read-only.'):window.console.log('Property "'+a+"\" doesn't exist. Please
check for typo."))};M.prototype.createUserOptions=function(a){if("undefined"!==typeof
a||this.options._isPlaceholder)if(this.parent.options._isPlaceholder&&this.parent.createUserO
ptions(),this.isOptionsInArray){this.parent.options[this.optionsName]||

(this.parent.options[this.optionsName]=[]);var
c=this.parent.options[this.optionsName],b=c.length;this.options._isPlaceholder||(ra(c),b=c.ind
exOf(this.options));this.options="undefined"===typeof a?{}:a;c[b]=this.options}else
this.options="undefined"===typeof
a?{}:a,a=this.parent.options,this.optionsName?c=this.optionsName:(c=this._defaultsKey)&&
0!==c.length?(b=c.charAt(0).toLowerCase(),1<c.length&&(b=b.concat(c.slice(1))),c=b):c=v
oid 0,a[c]=this.options};M.prototype.remove=function(a){a="undefined"===

typeof a?!0:a;if(this.isOptionsInArray){var c=this.parent.options[this.optionsName];ra(c);var


b=c.indexOf(this.options);0<=b&&c.splice(b,1)}else delete
this.parent.options[this.optionsName];a&&(chart=this.chart||this,chart.render())};M.prototype
.updateOption=function(a){var
c=ba[this._defaultsKey],b=this.options.theme?this.options.theme:this.chart&&this.chart.optio

103
Chatbot designing

ns.theme?this.chart.options.theme:"theme1",d={},f=this[a];b&&(ha[b]&&ha[b][this._default
sKey])&&(d=ha[b][this._defaultsKey]);a in c&&(f=

a in this.options?this.options[a]:d&&a in
d?d[a]:c[a]);if(f===this[a])return!1;this[a]=f;return!0};M.prototype.trackChanges=function(a
){if(!this.sessionVariables)throw"Session Variable Store not
set";this.sessionVariables[a]=this.options[a]};M.prototype.isBeingTracked=function(a){this.
options._oldOptions||(this.options._oldOptions={});return
this.options._oldOptions[a]?!0:!1};M.prototype.hasOptionChanged=function(a){if(!this.sessi
onVariables)throw"Session Variable Store not set";return this.sessionVariables[a]!==

this.options[a]};M.prototype.addEventListener=function(a,c,b){a&&c&&(this._eventListene
rs[a]=this._eventListeners[a]||[],this._eventListeners[a].push({context:b||this,eventHandler:c}
))};M.prototype.removeEventListener=function(a,c){if(a&&c&&this._eventListeners[a])for(
var
b=this._eventListeners[a],d=0;d<b.length;d++)if(b[d].eventHandler===c){b[d].splice(d,1);br
eak}};M.prototype.removeAllEventListeners=function(){this._eventListeners=[]};M.prototy
pe.dispatchEvent=function(a,c,b){if(a&&this._eventListeners[a]){c=

c||{};for(var
d=this._eventListeners[a],f=0;f<d.length;f++)d[f].eventHandler.call(d[f].context,c)}"function
"===typeof
this[a]&&this[a].call(b||this.chart,c)};U(A,M);A.prototype.destroy=function(){var
a=window,c=this.windowResizeHandler;a.removeEventListener?a.removeEventListener("res
ize",c):a.detachEvent&&a.detachEvent("onresize",c)};A.prototype._updateOptions=function(
){var
a=this;this.updateOption("width");this.updateOption("height");this.updateOption("dataPoint
Width");this.updateOption("dataPointMinWidth");

this.updateOption("dataPointMaxWidth");this.updateOption("interactivityEnabled");this.upd
ateOption("theme");this.updateOption("colorSet")&&(this._selectedColorSet="undefined"!=
=typeof
ga[this.colorSet]?ga[this.colorSet]:ga.colorSet1);this.updateOption("backgroundColor");this.
backgroundColor||(this.backgroundColor="rgba(0,0,0,0)");this.updateOption("culture");this._
cultureInfo=new

104
Chatbot designing

pa(this.options.culture);this.updateOption("animationEnabled");this.animationEnabled=this.a
nimationEnabled&&v;this.updateOption("animationDuration");

this.updateOption("rangeChanging");this.updateOption("rangeChanged");this.updateOption("
exportEnabled");this.updateOption("exportFileName");this.updateOption("zoomType");this.
options.zoomEnabled?(this._zoomButton||(Y(this._zoomButton=document.createElement("b
utton")),T(this,this._zoomButton,"pan"),this._toolBar.appendChild(this._zoomButton),K(this
._zoomButton,"click",function(){a.zoomEnabled?(a.zoomEnabled=!1,a.panEnabled=!0,T(a,a
._zoomButton,"zoom")):(a.zoomEnabled=!0,a.panEnabled=!1,T(a,a._zoomButton,

"pan"));a.render()})),this._resetButton||(Y(this._resetButton=document.createElement("butto
n")),T(this,this._resetButton,"reset"),this._toolBar.appendChild(this._resetButton),K(this._res
etButton,"click",function(){a.toolTip.hide();a.zoomEnabled||a.panEnabled?(a.zoomEnabled=
!0,a.panEnabled=!1,T(a,a._zoomButton,"pan"),a._defaultCursor="default",a.overlaidCanvas.
style.cursor=a._defaultCursor):(a.zoomEnabled=!1,a.panEnabled=!1);if(a.sessionVariables.a
xisX)for(var
b=0;b<a.sessionVariables.axisX.length;b++)a.sessionVariables.axisX[b].newViewportMinim
um=

null,a.sessionVariables.axisX[b].newViewportMaximum=null;if(a.sessionVariables.axisX2)f
or(b=0;b<a.sessionVariables.axisX2.length;b++)a.sessionVariables.axisX2[b].newViewport
Minimum=null,a.sessionVariables.axisX2[b].newViewportMaximum=null;if(a.sessionVariab
les.axisY)for(b=0;b<a.sessionVariables.axisY.length;b++)a.sessionVariables.axisY[b].newVi
ewportMinimum=null,a.sessionVariables.axisY[b].newViewportMaximum=null;if(a.session
Variables.axisY2)for(b=0;b<a.sessionVariables.axisY2.length;b++)a.sessionVariables.axisY
2[b].newViewportMinimum=

null,a.sessionVariables.axisY2[b].newViewportMaximum=null;a.resetOverlayedCanvas();Y(
a._zoomButton,a._resetButton);a._dispatchRangeEvent("rangeChanging","reset");a.render();
a._dispatchRangeEvent("rangeChanged","reset")}),this.overlaidCanvas.style.cursor=a._defau
ltCursor),this.zoomEnabled||this.panEnabled||(this._zoomButton?(a._zoomButton.getAttribut
e("state")===a._cultureInfo.zoomText?(this.panEnabled=!0,this.zoomEnabled=!1):(this.zoo
mEnabled=!0,this.panEnabled=!1),ua(a._zoomButton,a._resetButton)):

(this.zoomEnabled=!0,this.panEnabled=!1))):this.panEnabled=this.zoomEnabled=!1;this._me
nuButton?this.exportEnabled?ua(this._menuButton):Y(this._menuButton):this.exportEnabled

105
Chatbot designing

&&v&&(this._menuButton=document.createElement("button"),T(this,this._menuButton,"me
nu"),this._toolBar.appendChild(this._menuButton),K(this._menuButton,"click",function(){"n
one"!==a._dropdownMenu.style.display||a._dropDownCloseTime&&500>=(new
Date).getTime()-
a._dropDownCloseTime.getTime()||(a._dropdownMenu.style.display="block",

a._menuButton.blur(),a._dropdownMenu.focus())},!0));if(!this._dropdownMenu&&this.expo
rtEnabled&&v){this._dropdownMenu=document.createElement("div");this._dropdownMenu
.setAttribute("tabindex",-1);this._dropdownMenu.style.cssText="position: absolute; -webkit-
user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor:
pointer;right: 1px;top: 25px;min-width: 120px;outline: 0;border: 1px solid silver;font-size:
14px;font-family: Calibri, Verdana, sans-serif;padding: 5px 0px 5px 0px;text-align:
left;background-color: #fff;line-height: 20px;box-shadow: 2px 2px 10px #888888;";

a._dropdownMenu.style.display="none";this._toolBar.appendChild(this._dropdownMenu);K(
this._dropdownMenu,"blur",function(){Y(a._dropdownMenu);a._dropDownCloseTime=new
Date},!0);var c=document.createElement("div");c.style.cssText="padding: 2px 15px 2px
10px";c.innerHTML=this._cultureInfo.printText;this._dropdownMenu.appendChild(c);K(c,"
mouseover",function(){this.style.backgroundColor="#EEEEEE"},!0);K(c,"mouseout",functi
on(){this.style.backgroundColor="transparent"},!0);K(c,"click",function(){a.print();

Y(a._dropdownMenu)},!0);c=document.createElement("div");c.style.cssText="padding: 2px
15px 2px
10px";c.innerHTML=this._cultureInfo.saveJPGText;this._dropdownMenu.appendChild(c);K
(c,"mouseover",function(){this.style.backgroundColor="#EEEEEE"},!0);K(c,"mouseout",fun
ction(){this.style.backgroundColor="transparent"},!0);K(c,"click",function(){Ca(a.canvas,"jp
eg",a.exportFileName);Y(a._dropdownMenu)},!0);c=document.createElement("div");c.style.
cssText="padding: 2px 15px 2px 10px";c.innerHTML=this._cultureInfo.savePNGText;

this._dropdownMenu.appendChild(c);K(c,"mouseover",function(){this.style.backgroundColo
r="#EEEEEE"},!0);K(c,"mouseout",function(){this.style.backgroundColor="transparent"},!0
);K(c,"click",function(){Ca(a.canvas,"png",a.exportFileName);Y(a._dropdownMenu)},!0)}"n
one"!==this._toolBar.style.display&&this._zoomButton&&(this.panEnabled?T(a,a._zoomBu
tton,"zoom"):T(a,a._zoomButton,"pan"),a._resetButton.getAttribute("state")!==a._cultureInf
o.resetText&&T(a,a._resetButton,"reset"));this.options.toolTip&&this.toolTip.options!==

106
Chatbot designing

this.options.toolTip&&(this.toolTip.options=this.options.toolTip);for(var b in
this.toolTip.options)this.toolTip.options.hasOwnProperty(b)&&this.toolTip.updateOption(b)
};A.prototype._updateSize=function(){var
a=0,c=0;this.options.width?a=this.width:this.width=a=0<this.container.clientWidth?this.cont
ainer.clientWidth:this.width;this.options.height?c=this.height:this.height=c=0<this.container.
clientHeight?this.container.clientHeight:this.height;return
this.canvas.width!==a*Q||this.canvas.height!==c*

Q?(sa(this.canvas,a,c),sa(this.overlaidCanvas,a,c),sa(this._eventManager.ghostCanvas,a,c),!0
):!1};A.prototype._initialize=function(){this._animator?this._animator.cancelAllAnimations(
):this._animator=new
Ea(this);this.removeAllEventListeners();this.disableToolTip=!1;this._axes=[];this.pieDoughn
utClickHandler=null;this.animationRequestId&&this.cancelRequestAnimFrame.call(window
,this.animationRequestId);this._updateOptions();this.animatedRender=v&&this.animationEn
abled&&0===this.renderCount;this._updateSize();

this.clearCanvas();this.ctx.beginPath();this.axisX=[];this.axisX2=[];this.axisY=[];this.axisY2
=[];this._indexLabels=[];this._dataInRenderedOrder=[];this._events=[];this._eventManager&
&this._eventManager.reset();this.plotInfo={axisPlacement:null,axisXValueType:null,plotTy
pes:[]};this.layoutManager=new
ia(0,0,this.width,this.height,2);this.plotArea.layoutManager&&this.plotArea.layoutManager.r
eset();this.data=[];var a=0;if(this.options.data)for(var
c=0;c<this.options.data.length;c++)if(a++,!this.options.data[c].type||

0<=A._supportedChartTypes.indexOf(this.options.data[c].type)){var b=new
$(this,this.options.data[c],a-
1,++this._eventManager.lastObjectId);null===b.name&&(b.name="DataSeries
"+a);null===b.color?1<this.options.data.length?(b._colorSet=[this._selectedColorSet[b.index
%this._selectedColorSet.length]],b.color=this._selectedColorSet[b.index%this._selectedColo
rSet.length]):b._colorSet="line"===b.type||"stepLine"===b.type||"spline"===b.type||"area"==
=b.type||"stepArea"===b.type||"splineArea"===b.type||"stackedArea"===

b.type||"stackedArea100"===b.type||"rangeArea"===b.type||"rangeSplineArea"===b.type||"c
andlestick"===b.type||"ohlc"===b.type?[this._selectedColorSet[0]]:this._selectedColorSet:b.
_colorSet=[b.color];null===b.markerSize&&(("line"===b.type||"stepLine"===b.type||"spline
"===b.type||0<=b.type.toLowerCase().indexOf("area"))&&b.dataPoints&&b.dataPoints.lengt

107
Chatbot designing

h<this.width/16||"scatter"===b.type)&&(b.markerSize=8);"bubble"!==b.type&&"scatter"!==
b.type||!b.dataPoints||(b.dataPoints.some?b.dataPoints.some(function(a){return a.x})&&

b.dataPoints.sort(Ja):b.dataPoints.sort(Ja));this.data.push(b);var
d=b.axisPlacement,f;"normal"===d?"xySwapped"===this.plotInfo.axisPlacement?f='You
cannot combine "'+b.type+'" with bar chart':"none"===this.plotInfo.axisPlacement?f='You
cannot combine "'+b.type+'" with pie
chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="normal"):"xySwa
pped"===d?"normal"===this.plotInfo.axisPlacement?f='You cannot combine "'+b.type+'"
with line, area, column or pie chart':"none"===this.plotInfo.axisPlacement?

f='You cannot combine "'+b.type+'" with pie


chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="xySwapped"):"no
ne"==d&&("normal"===this.plotInfo.axisPlacement?f='You cannot combine "'+b.type+'"
with line, area, column or bar chart':"xySwapped"===this.plotInfo.axisPlacement?f='You
cannot combine "'+b.type+'" with bar
chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="none"));if(f&&wi
ndow.console){window.console.log(f);return}}/*var
g=this;this.addEventListener("dataAnimationIterationEnd",

function(){z.fAWm&&z.fAWm(g);0!==g.axisX.length&&z.fNg&&z.fNg(g)});*/Sa(this);thi
s._objectsInitialized=!0};A._supportedChartTypes=ra("line stepLine spline column area
stepArea splineArea bar bubble scatter stackedColumn stackedColumn100 stackedBar
stackedBar100 stackedArea stackedArea100 candlestick ohlc rangeColumn rangeBar
rangeArea rangeSplineArea pie doughnut funnel".split("
"));A.prototype.render=function(a){a&&(this.options=a);this._initialize();var
c=[];for(a=0;a<this.data.length;a++)if("normal"===

this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement){if(!this.data[a].axi
sYType||"primary"===this.data[a].axisYType)if(this.options.axisY&&0<this.options.axisY.l
ength){if(!this.axisY.length)for(var
b=0;b<this.options.axisY.length;b++)"normal"===this.plotInfo.axisPlacement?this._axes.pus
h(this.axisY[b]=new
B(this,this.options.axisY[b],"axisY","left",b)):"xySwapped"===this.plotInfo.axisPlacement&
&this._axes.push(this.axisY[b]=new B(this,this.options.axisY[b],"axisY","bottom",b));

108
Chatbot designing

this.data[a].axisY=this.axisY[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<this.axi
sY.length?this.data[a].axisYIndex:0];this.axisY[0<=this.data[a].axisYIndex&&this.data[a].ax
isYIndex<this.axisY.length?this.data[a].axisYIndex:0].dataSeries.push(this.data[a])}else
this.axisY.length||("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisY[0]=ne
w
B(this,this.options.axisY,"axisY","left",0)):"xySwapped"===this.plotInfo.axisPlacement&&t
his._axes.push(this.axisY[0]=new B(this,this.options.axisY,

"axisY","bottom",0))),this.data[a].axisY=this.axisY[0],this.axisY[0].dataSeries.push(this.data
[a]);if("secondary"===this.data[a].axisYType)if(this.options.axisY2&&0<this.options.axisY
2.length){if(!this.axisY2.length)for(b=0;b<this.options.axisY2.length;b++)"normal"===this.p
lotInfo.axisPlacement?this._axes.push(this.axisY2[b]=new
B(this,this.options.axisY2[b],"axisY","right",b)):"xySwapped"===this.plotInfo.axisPlacemen
t&&this._axes.push(this.axisY2[b]=new B(this,this.options.axisY2[b],"axisY","top",

b));this.data[a].axisY=this.axisY2[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<thi
s.axisY2.length?this.data[a].axisYIndex:0];this.axisY2[0<=this.data[a].axisYIndex&&this.da
ta[a].axisYIndex<this.axisY2.length?this.data[a].axisYIndex:0].dataSeries.push(this.data[a])}
else
this.axisY2.length||("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisY2[0]=
new
B(this,this.options.axisY2,"axisY","right",0)):"xySwapped"===this.plotInfo.axisPlacement&
&this._axes.push(this.axisY2[0]=new B(this,

this.options.axisY2,"axisY","top",0))),this.data[a].axisY=this.axisY2[0],this.axisY2[0].dataS
eries.push(this.data[a]);if(!this.data[a].axisXType||"primary"===this.data[a].axisXType)if(thi
s.options.axisX&&0<this.options.axisX.length){if(!this.axisX.length)for(b=0;b<this.options.
axisX.length;b++)"normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisX[b]=ne
w
B(this,this.options.axisX[b],"axisX","bottom",b)):"xySwapped"===this.plotInfo.axisPlaceme
nt&&this._axes.push(this.axisX[b]=new B(this,

this.options.axisX[b],"axisX","left",b));this.data[a].axisX=this.axisX[0<=this.data[a].axisXIn
dex&&this.data[a].axisXIndex<this.axisX.length?this.data[a].axisXIndex:0];this.axisX[0<=th
is.data[a].axisXIndex&&this.data[a].axisXIndex<this.axisX.length?this.data[a].axisXIndex:0
].dataSeries.push(this.data[a])}else

109
Chatbot designing

this.axisX.length||("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisX[0]=ne
w
B(this,this.options.axisX,"axisX","bottom",0)):"xySwapped"===this.plotInfo.axisPlacement
&&this._axes.push(this.axisX[0]=

new
B(this,this.options.axisX,"axisX","left",0))),this.data[a].axisX=this.axisX[0],this.axisX[0].dat
aSeries.push(this.data[a]);if("secondary"===this.data[a].axisXType)if(this.options.axisX2&
&0<this.options.axisX2.length){if(!this.axisX2.length)for(b=0;b<this.options.axisX2.length;
b++)"normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisX2[b]=new
B(this,this.options.axisX2[b],"axisX","top",b)):"xySwapped"===this.plotInfo.axisPlacement
&&this._axes.push(this.axisX2[b]=new B(this,this.options.axisX2[b],

"axisX","right",b));this.data[a].axisX=this.axisX2[0<=this.data[a].axisXIndex&&this.data[a].
axisXIndex<this.axisX2.length?this.data[a].axisXIndex:0];this.axisX2[0<=this.data[a].axisXI
ndex&&this.data[a].axisXIndex<this.axisX2.length?this.data[a].axisXIndex:0].dataSeries.pus
h(this.data[a])}else
this.axisX2.length||("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisX2[0]=
new
B(this,this.options.axisX2,"axisX","top",0)):"xySwapped"===this.plotInfo.axisPlacement&&
this._axes.push(this.axisX2[0]=

new
B(this,this.options.axisX2,"axisX","right",0))),this.data[a].axisX=this.axisX2[0],this.axisX2[
0].dataSeries.push(this.data[a])}if(this.axisY){for(b=1;b<this.axisY.length;b++)"undefined"=
==typeof
this.axisY[b].options.gridThickness&&(this.axisY[b].gridThickness=0);for(b=0;b<this.axisY
.length-1;b++)"undefined"===typeof
this.axisY[b].options.margin&&(this.axisY[b].margin=10)}if(this.axisY2){for(b=1;b<this.ax
isY2.length;b++)"undefined"===typeof
this.axisY2[b].options.gridThickness&&(this.axisY2[b].gridThickness=

0);for(b=0;b<this.axisY2.length-1;b++)"undefined"===typeof
this.axisY2[b].options.margin&&(this.axisY2[b].margin=10)}this.axisY&&0<this.axisY.len
gth&&(this.axisY2&&0<this.axisY2.length)&&(0<this.axisY[0].gridThickness&&"undefine
d"===typeof

110
Chatbot designing

this.axisY2[0].options.gridThickness?this.axisY2[0].gridThickness=0:0<this.axisY2[0].gridT
hickness&&"undefined"===typeof
this.axisY[0].options.gridThickness&&(this.axisY[0].gridThickness=0));if(this.axisX)for(b=
0;b<this.axisX.length;b++)"undefined"===typeof this.axisX[b].options.gridThickness&&

(this.axisX[b].gridThickness=0);if(this.axisX2)for(b=0;b<this.axisX2.length;b++)"undefined
"===typeof
this.axisX2[b].options.gridThickness&&(this.axisX2[b].gridThickness=0);this.axisX&&0<th
is.axisX.length&&(this.axisX2&&0<this.axisX2.length)&&(0<this.axisX[0].gridThickness&
&"undefined"===typeof
this.axisX2[0].options.gridThickness?this.axisX2[0].gridThickness=0:0<this.axisX2[0].gridT
hickness&&"undefined"===typeof
this.axisX[0].options.gridThickness&&(this.axisX[0].gridThickness=0));b=!1;if(0<this._axes
.length&&

(this.zoomEnabled||this.panEnabled))for(a=0;a<this._axes.length;a++)if(null!==this._axes[a].
viewportMinimum||null!==this._axes[a].viewportMaximum){b=!0;break}b?ua(this._zoomBu
tton,this._resetButton):(Y(this._zoomButton,this._resetButton),this.options.zoomEnabled&&
(this.zoomEnabled=!0,this.panEnabled=!1));this._processData();this.options.title&&(this.title
=new
na(this,this.options.title),this.title.dockInsidePlotArea?c.push(this.title):this.title.render());if(t
his.options.subtitles)for(this.subtitles=

[],a=0;a<this.options.subtitles.length;a++)b=new
wa(this,this.options.subtitles[a]),this.subtitles.push(b),b.dockInsidePlotArea?c.push(b):b.rend
er();this.legend=new
xa(this,this.options.legend);for(a=0;a<this.data.length;a++)(this.data[a].showInLegend||"pie"
===this.data[a].type||"doughnut"===this.data[a].type)&&this.legend.dataSeries.push(this.dat
a[a]);this.legend.dockInsidePlotArea?c.push(this.legend):this.legend.render();if("normal"===
this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)B.setLayoutAndRe
nder(this.axisX,

this.axisX2,this.axisY,this.axisY2,this.plotInfo.axisPlacement,this.layoutManager.getFreeSpa
ce());else if("none"===this.plotInfo.axisPlacement)this.preparePlotArea();else
return;for(a=0;a<c.length;a++)c[a].render();var d=[];if(this.animatedRender){var
f=fa(this.width,this.height);f.getContext("2d").drawImage(this.canvas,0,0,this.width,this.heig

111
Chatbot designing

ht)}for(a=0;a<this.plotInfo.plotTypes.length;a++)for(var
c=this.plotInfo.plotTypes[a],g=0;g<c.plotUnits.length;g++){var
h=c.plotUnits[g],k=null;h.targetCanvas=

null;this.animatedRender&&(h.targetCanvas=fa(this.width,this.height),h.targetCanvasCtx=h.
targetCanvas.getContext("2d"));"line"===h.type?k=this.renderLine(h):"stepLine"===h.type?
k=this.renderStepLine(h):"spline"===h.type?k=this.renderSpline(h):"column"===h.type?k=t
his.renderColumn(h):"bar"===h.type?k=this.renderBar(h):"area"===h.type?k=this.renderAre
a(h):"stepArea"===h.type?k=this.renderStepArea(h):"splineArea"===h.type?k=this.renderSp
lineArea(h):"stackedColumn"===h.type?k=this.renderStackedColumn(h):

"stackedColumn100"===h.type?k=this.renderStackedColumn100(h):"stackedBar"===h.type
?k=this.renderStackedBar(h):"stackedBar100"===h.type?k=this.renderStackedBar100(h):"sta
ckedArea"===h.type?k=this.renderStackedArea(h):"stackedArea100"===h.type?k=this.rende
rStackedArea100(h):"bubble"===h.type?k=k=this.renderBubble(h):"scatter"===h.type?k=thi
s.renderScatter(h):"pie"===h.type?this.renderPie(h):"doughnut"===h.type?this.renderPie(h):
"candlestick"===h.type?k=this.renderCandlestick(h):"ohlc"===h.type?k=this.renderCandlest
ick(h):

"rangeColumn"===h.type?k=this.renderRangeColumn(h):"rangeBar"===h.type?k=this.rende
rRangeBar(h):"rangeArea"===h.type?k=this.renderRangeArea(h):"rangeSplineArea"===h.ty
pe&&(k=this.renderRangeSplineArea(h));for(b=0;b<h.dataSeriesIndexes.length;b++)this._da
taInRenderedOrder.push(this.data[h.dataSeriesIndexes[b]]);this.animatedRender&&k&&d.pu
sh(k)}this.animatedRender&&0<this._indexLabels.length&&(a=fa(this.width,this.height).get
Context("2d"),d.push(this.renderIndexLabels(a)));var l=this;0<d.length?(l.disableToolTip=

!0,l._animator.animate(200,l.animationDuration,function(a){l.ctx.clearRect(0,0,l.width,l.heig
ht);l.ctx.drawImage(f,0,0,Math.floor(l.width*Q),Math.floor(l.height*Q),0,0,l.width,l.height);f
or(var b=0;b<d.length;b++)k=d[b],1>a&&"undefined"!==typeof
k.startTimePercent?a>=k.startTimePercent&&k.animationCallback(k.easingFunction(a-
k.startTimePercent,0,1,1-
k.startTimePercent),k):k.animationCallback(k.easingFunction(a,0,1,1),k);l.dispatchEvent("da
taAnimationIterationEnd",{chart:l})},function(){d=[];for(var a=

0;a<l.plotInfo.plotTypes.length;a++)for(var
b=l.plotInfo.plotTypes[a],c=0;c<b.plotUnits.length;c++)b.plotUnits[c].targetCanvas=null;f=n

112
Chatbot designing

ull;l.disableToolTip=!1})):(0<l._indexLabels.length&&l.renderIndexLabels(),l.dispatchEvent
("dataAnimationIterationEnd",{chart:l}));this.attachPlotAreaEventHandlers();this.zoomEnabl
ed||(this.panEnabled||!this._zoomButton||"none"===this._zoomButton.style.display)||Y(this._
zoomButton,this._resetButton);this.toolTip._updateToolTip();this.renderCount++};A.prototy
pe.attachPlotAreaEventHandlers=

function(){this.attachEvent({context:this,chart:this,mousedown:this._plotAreaMouseDown,m
ouseup:this._plotAreaMouseUp,mousemove:this._plotAreaMouseMove,cursor:this.zoomEna
bled?"col-
resize":"move",cursor:this.panEnabled?"move":"default",capture:!0,bounds:this.plotArea})};
A.prototype.categoriseDataSeries=function(){for(var
a="",c=0;c<this.data.length;c++)if(a=this.data[c],a.dataPoints&&(0!==a.dataPoints.length&
&a.visible)&&0<=A._supportedChartTypes.indexOf(a.type)){for(var
b=null,d=!1,f=null,g=!1,h=

0;h<this.plotInfo.plotTypes.length;h++)if(this.plotInfo.plotTypes[h].type===a.type){d=!0;b=
this.plotInfo.plotTypes[h];break}d||(b={type:a.type,totalDataSeries:0,plotUnits:[]},this.plotIn
fo.plotTypes.push(b));for(h=0;h<b.plotUnits.length;h++)if(b.plotUnits[h].axisYType===a.ax
isYType&&b.plotUnits[h].axisXType===a.axisXType&&b.plotUnits[h].axisYIndex===a.ax
isYIndex&&b.plotUnits[h].axisXIndex===a.axisXIndex){g=!0;f=b.plotUnits[h];break}g||(f=
{type:a.type,previousDataSeriesCount:0,index:b.plotUnits.length,

plotType:b,axisXType:a.axisXType,axisYType:a.axisYType,axisYIndex:a.axisYIndex,axisX
Index:a.axisXIndex,axisY:"primary"===a.axisYType?this.axisY[0<=a.axisYIndex&&a.axis
YIndex<this.axisY.length?a.axisYIndex:0]:this.axisY2[0<=a.axisYIndex&&a.axisYIndex<th
is.axisY2.length?a.axisYIndex:0],axisX:"primary"===a.axisXType?this.axisX[0<=a.axisXIn
dex&&a.axisXIndex<this.axisX.length?a.axisXIndex:0]:this.axisX2[0<=a.axisXIndex&&a.a
xisXIndex<this.axisX2.length?a.axisXIndex:0],dataSeriesIndexes:[],yTotals:[]},b.plotUnits.p
ush(f));

b.totalDataSeries++;f.dataSeriesIndexes.push(c);a.plotUnit=f}for(c=0;c<this.plotInfo.plotTy
pes.length;c++)for(b=this.plotInfo.plotTypes[c],h=a=0;h<b.plotUnits.length;h++)b.plotUnits[
h].previousDataSeriesCount=a,a+=b.plotUnits[h].dataSeriesIndexes.length};A.prototype.assi
gnIdToDataPoints=function(){for(var a=0;a<this.data.length;a++){var
c=this.data[a];if(c.dataPoints)for(var

113
Chatbot designing

b=c.dataPoints.length,d=0;d<b;d++)c.dataPointIds[d]=++this._eventManager.lastObjectId}};
A.prototype._processData=function(){this.assignIdToDataPoints();

this.categoriseDataSeries();for(var a=0;a<this.plotInfo.plotTypes.length;a++)for(var
c=this.plotInfo.plotTypes[a],b=0;b<c.plotUnits.length;b++){var
d=c.plotUnits[b];"line"===d.type||"stepLine"===d.type||"spline"===d.type||"column"===d.ty
pe||"area"===d.type||"stepArea"===d.type||"splineArea"===d.type||"bar"===d.type||"bubble"
===d.type||"scatter"===d.type?this._processMultiseriesPlotUnit(d):"stackedColumn"===d.ty
pe||"stackedBar"===d.type||"stackedArea"===d.type?this._processStackedPlotUnit(d):"stack
edColumn100"===

d.type||"stackedBar100"===d.type||"stackedArea100"===d.type?this._processStacked100Plot
Unit(d):"candlestick"!==d.type&&"ohlc"!==d.type&&"rangeColumn"!==d.type&&"rangeBa
r"!==d.type&&"rangeArea"!==d.type&&"rangeSplineArea"!==d.type||this._processMultiYPl
otUnit(d)}};A.prototype._processMultiseriesPlotUnit=function(a){if(a.dataSeriesIndexes&&
!(1>a.dataSeriesIndexes.length))for(var
c=a.axisY.dataInfo,b=a.axisX.dataInfo,d,f,g=!1,h=0;h<a.dataSeriesIndexes.length;h++){var
k=this.data[a.dataSeriesIndexes[h]],

l=0,m=!1,n=!1,p;if("normal"===k.axisPlacement||"xySwapped"===k.axisPlacement)var
e=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewport
Minimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.vie
wportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minim
um:a.axisX.logarithmic?0:-
Infinity,r=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newVi
ewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum?

this.options.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?thi
s.options.axisX.maximum:Infinity;if(k.dataPoints[l].x&&k.dataPoints[l].x.getTime||"dateTim
e"===k.xValueType)g=!0;for(l=0;l<k.dataPoints.length;l++){"undefined"===typeof
k.dataPoints[l].x&&(k.dataPoints[l].x=l+(a.axisX.logarithmic?1:0));k.dataPoints[l].x.getTime
?(g=!0,d=k.dataPoints[l].x.getTime()):d=k.dataPoints[l].x;f=k.dataPoints[l].y;d<b.min&&(b.
min=d);d>b.max&&(b.max=d);f<c.min&&(c.min=f);f>c.max&&(c.max=f);if(0<

l){if(a.axisX.logarithmic){var q=d/k.dataPoints[l-
1].x;1>q&&(q=1/q);b.minDiff>q&&1!==q&&(b.minDiff=q)}else q=d-k.dataPoints[l-

114
Chatbot designing

1].x,0>q&&(q*=-
1),b.minDiff>q&&0!==q&&(b.minDiff=q);null!==f&&null!==k.dataPoints[l-
1].y&&(a.axisY.logarithmic?(q=f/k.dataPoints[l-
1].y,1>q&&(q=1/q),c.minDiff>q&&1!==q&&(c.minDiff=q)):(q=f-k.dataPoints[l-
1].y,0>q&&(q*=-
1),c.minDiff>q&&0!==q&&(c.minDiff=q)))}if(d<e&&!m)null!==f&&(p=d);else{if(!m&&(
m=!0,0<l)){l-=2;continue}if(d>r&&!n)n=!0;else
if(d>r&&n)continue;k.dataPoints[l].label&&

(a.axisX.labels[d]=k.dataPoints[l].label);d<b.viewPortMin&&(b.viewPortMin=d);d>b.viewP
ortMax&&(b.viewPortMax=d);null===f?b.viewPortMin===d&&p<d&&(b.viewPortMin=p)
:(f<c.viewPortMin&&(c.viewPortMin=f),f>c.viewPortMax&&(c.viewPortMax=f))}}this.plo
tInfo.axisXValueType=k.xValueType=g?"dateTime":"number"}};A.prototype._processStack
edPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var
c=a.axisY.dataInfo,b=a.axisX.dataInfo,d,f,g=!1,h=[],k=[],l=Infinity,m=0;m<a.dataSeriesInde
xes.length;m++){var n=

this.data[a.dataSeriesIndexes[m]],p=0,e=!1,r=!1,q;if("normal"===n.axisPlacement||"xySwap
ped"===n.axisPlacement)var
s=this.sessionVariables.axisX.newViewportMinimum?this.sessionVariables.axisX.newView
portMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX
.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.mi
nimum:-
Infinity,u=this.sessionVariables.axisX.newViewportMaximum?this.sessionVariables.axisX.n
ewViewportMaximum:this.options.axisX&&

this.options.axisX.viewportMaximum?this.options.axisX.viewportMaximum:this.options.axi
sX&&this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(n.dataPoints[p].x
&&n.dataPoints[p].x.getTime||"dateTime"===n.xValueType)g=!0;for(p=0;p<n.dataPoints.le
ngth;p++){"undefined"===typeof
n.dataPoints[p].x&&(n.dataPoints[p].x=p+(a.axisX.logarithmic?1:0));n.dataPoints[p].x.getTi
me?(g=!0,d=n.dataPoints[p].x.getTime()):d=n.dataPoints[p].x;x(n.dataPoints[p].y)?f=0:(f=n.
dataPoints[p].y,0===m&&(l=Math.min(f,

l)));d<b.min&&(b.min=d);d>b.max&&(b.max=d);if(0<p){if(a.axisX.logarithmic){var
w=d/n.dataPoints[p-1].x;1>w&&(w=1/w);b.minDiff>w&&1!==w&&(b.minDiff=w)}else

115
Chatbot designing

w=d-n.dataPoints[p-1].x,0>w&&(w*=-
1),b.minDiff>w&&0!==w&&(b.minDiff=w);null!==f&&null!==n.dataPoints[p-
1].y&&(a.axisY.logarithmic?0<f&&(w=f/n.dataPoints[p-
1].y,1>w&&(w=1/w),c.minDiff>w&&1!==w&&(c.minDiff=w)):(w=f-n.dataPoints[p-
1].y,0>w&&(w*=-
1),c.minDiff>w&&0!==w&&(c.minDiff=w)))}if(d<s&&!e)null!==n.dataPoints[p].y&&(q=d
);else{if(!e&&(e=!0,0<p)){p-=

2;continue}if(d>u&&!r)r=!0;else
if(d>u&&r)continue;n.dataPoints[p].label&&(a.axisX.labels[d]=n.dataPoints[p].label);d<b.vi
ewPortMin&&(b.viewPortMin=d);d>b.viewPortMax&&(b.viewPortMax=d);null===n.dataP
oints[p].y?b.viewPortMin===d&&q<d&&(b.viewPortMin=q):(a.yTotals[d]=(a.yTotals[d]?a.
yTotals[d]:0)+Math.abs(f),0<=f?h[d]=h[d]?h[d]+f:f:k[d]=k[d]?k[d]+f:f)}}this.plotInfo.axisX
ValueType=n.xValueType=g?"dateTime":"number"}for(p in
h)h.hasOwnProperty(p)&&!isNaN(p)&&(a=h[p],a<c.min&&(c.min=Math.min(a,l)),a>

c.max&&(c.max=a),p<b.viewPortMin||p>b.viewPortMax||(a<c.viewPortMin&&(c.viewPort
Min=Math.min(a,l)),a>c.viewPortMax&&(c.viewPortMax=a)));for(p in
k)k.hasOwnProperty(p)&&!isNaN(p)&&(a=k[p],a<c.min&&(c.min=Math.min(a,l)),a>c.max
&&(c.max=a),p<b.viewPortMin||p>b.viewPortMax||(a<c.viewPortMin&&(c.viewPortMin=
Math.min(a,l)),a>c.viewPortMax&&(c.viewPortMax=a)))}};A.prototype._processStacked10
0PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var
c=a.axisY.dataInfo,b=a.axisX.dataInfo,

d,f,g=!1,h=!1,k=!1,l=[],m=0;m<a.dataSeriesIndexes.length;m++){var
n=this.data[a.dataSeriesIndexes[m]],p=0,e=!1,r=!1,q;if("normal"===n.axisPlacement||"xySw
apped"===n.axisPlacement)var
s=this.sessionVariables.axisX.newViewportMinimum?this.sessionVariables.axisX.newView
portMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX
.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.mi
nimum:-Infinity,u=this.sessionVariables.axisX.newViewportMaximum?

this.sessionVariables.axisX.newViewportMaximum:this.options.axisX&&this.options.axisX.
viewportMaximum?this.options.axisX.viewportMaximum:this.options.axisX&&this.options.
axisX.maximum?this.options.axisX.maximum:Infinity;if(n.dataPoints[p].x&&n.dataPoints[p]
.x.getTime||"dateTime"===n.xValueType)g=!0;for(p=0;p<n.dataPoints.length;p++){"undefin

116
Chatbot designing

ed"===typeof
n.dataPoints[p].x&&(n.dataPoints[p].x=p+(a.axisX.logarithmic?1:0));n.dataPoints[p].x.getTi
me?(g=!0,d=n.dataPoints[p].x.getTime()):d=n.dataPoints[p].x;

f=x(n.dataPoints[p].y)?null:n.dataPoints[p].y;d<b.min&&(b.min=d);d>b.max&&(b.max=d);i
f(0<p){if(a.axisX.logarithmic){var w=d/n.dataPoints[p-
1].x;1>w&&(w=1/w);b.minDiff>w&&1!==w&&(b.minDiff=w)}else w=d-n.dataPoints[p-
1].x,0>w&&(w*=-1),b.minDiff>w&&0!==w&&(b.minDiff=w);x(f)||null===n.dataPoints[p-
1].y||(a.axisY.logarithmic?0<f&&(w=f/n.dataPoints[p-
1].y,1>w&&(w=1/w),c.minDiff>w&&1!==w&&(c.minDiff=w)):(w=f-n.dataPoints[p-
1].y,0>w&&(w*=-
1),c.minDiff>w&&0!==w&&(c.minDiff=w)))}if(d<s&&!e)null!==f&&(q=d);

else{if(!e&&(e=!0,0<p)){p-=2;continue}if(d>u&&!r)r=!0;else
if(d>u&&r)continue;n.dataPoints[p].label&&(a.axisX.labels[d]=n.dataPoints[p].label);d<b.vi
ewPortMin&&(b.viewPortMin=d);d>b.viewPortMax&&(b.viewPortMax=d);null===f?b.vie
wPortMin===d&&q<d&&(b.viewPortMin=q):(a.yTotals[d]=(a.yTotals[d]?a.yTotals[d]:0)+
Math.abs(f),0<=f?h=!0:0>f&&(k=!0),l[d]=l[d]?l[d]+Math.abs(f):Math.abs(f))}}this.plotInfo.
axisXValueType=n.xValueType=g?"dateTime":"number"}a.axisY.logarithmic?(c.max=x(c.v
iewPortMax)?99*Math.pow(a.axisY.logarithmBase,

-0.05):Math.max(c.viewPortMax,99*Math.pow(a.axisY.logarithmBase,-
0.05)),c.min=x(c.viewPortMin)?1:Math.min(c.viewPortMin,1)):h&&!k?(c.max=x(c.viewPort
Max)?99:Math.max(c.viewPortMax,99),c.min=x(c.viewPortMin)?1:Math.min(c.viewPortMi
n,1)):h&&k?(c.max=x(c.viewPortMax)?99:Math.max(c.viewPortMax,99),c.min=x(c.viewPor
tMin)?-99:Math.min(c.viewPortMin,-99)):!h&&k&&(c.max=x(c.viewPortMax)?-
1:Math.max(c.viewPortMax,-1),c.min=x(c.viewPortMin)?-99:Math.min(c.viewPortMin,-
99));c.viewPortMin=c.min;c.viewPortMax=

c.max;a.dataPointYSums=l}};A.prototype._processMultiYPlotUnit=function(a){if(a.dataSeri
esIndexes&&!(1>a.dataSeriesIndexes.length))for(var
c=a.axisY.dataInfo,b=a.axisX.dataInfo,d,f,g,h,k=!1,l=0;l<a.dataSeriesIndexes.length;l++){va
r
m=this.data[a.dataSeriesIndexes[l]],n=0,p=!1,e=!1,r,q,s;if("normal"===m.axisPlacement||"xy
Swapped"===m.axisPlacement)var

117
Chatbot designing

u=this.sessionVariables.axisX.newViewportMinimum?this.sessionVariables.axisX.newView
portMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?

this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.
options.axisX.minimum:-
Infinity,w=this.sessionVariables.axisX.newViewportMaximum?this.sessionVariables.axisX.n
ewViewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum?this.optio
ns.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?this.options.
axisX.maximum:Infinity;if(m.dataPoints[n].x&&m.dataPoints[n].x.getTime||"dateTime"===
m.xValueType)k=!0;for(n=0;n<m.dataPoints.length;n++){"undefined"===

typeof
m.dataPoints[n].x&&(m.dataPoints[n].x=n+(a.axisX.logarithmic?1:0));m.dataPoints[n].x.get
Time?(k=!0,d=m.dataPoints[n].x.getTime()):d=m.dataPoints[n].x;if((f=m.dataPoints[n].y)&
&f.length){g=Math.min.apply(null,f);h=Math.max.apply(null,f);q=!0;for(var
y=0;y<f.length;y++)null===f.k&&(q=!1);q&&(p||(s=r),r=d)}d<b.min&&(b.min=d);d>b.max
&&(b.max=d);g<c.min&&(c.min=g);h>c.max&&(c.max=h);0<n&&(a.axisX.logarithmic?(q
=d/m.dataPoints[n-1].x,1>q&&(q=1/q),b.minDiff>q&&1!==q&&(b.minDiff=q)):(q=d-
m.dataPoints[n-

1].x,0>q&&(q*=-
1),b.minDiff>q&&0!==q&&(b.minDiff=q)),f&&(null!==f[0]&&m.dataPoints[n-
1].y&&null!==m.dataPoints[n-1].y[0])&&(a.axisY.logarithmic?(q=f[0]/m.dataPoints[n-
1].y[0],1>q&&(q=1/q),c.minDiff>q&&1!==q&&(c.minDiff=q)):(q=f[0]-m.dataPoints[n-
1].y[0],0>q&&(q*=-
1),c.minDiff>q&&0!==q&&(c.minDiff=q))));if(!(d<u)||p){if(!p&&(p=!0,0<n)){n-
=2;r=s;continue}if(d>w&&!e)e=!0;else
if(d>w&&e)continue;m.dataPoints[n].label&&(a.axisX.labels[d]=m.dataPoints[n].label);d<b.
viewPortMin&&(b.viewPortMin=d);d>b.viewPortMax&&

(b.viewPortMax=d);if(b.viewPortMin===d&&f)for(y=0;y<f.length;y++)if(null===f[y]&&r<
d){b.viewPortMin=r;break}null===f?b.viewPortMin===d&&r<d&&(b.viewPortMin=r):(g<
c.viewPortMin&&(c.viewPortMin=g),h>c.viewPortMax&&(c.viewPortMax=h))}}this.plotIn
fo.axisXValueType=m.xValueType=k?"dateTime":"number"}};A.prototype.getDataPointAt
XY=function(a,c,b){b=b||!1;for(var d=[],f=this._dataInRenderedOrder.length-1;0<=f;f--){var

118
Chatbot designing

g=null;(g=this._dataInRenderedOrder[f].getDataPointAtXY(a,c,b))&&d.push(g)}a=null;c=!1
;

for(b=0;b<d.length;b++)if("line"===d[b].dataSeries.type||"stepLine"===d[b].dataSeries.type||
"area"===d[b].dataSeries.type||"stepArea"===d[b].dataSeries.type)if(f=L("markerSize",d[b].
dataPoint,d[b].dataSeries)||8,d[b].distance<=f/2){c=!0;break}for(b=0;b<d.length;b++)c&&"li
ne"!==d[b].dataSeries.type&&"stepLine"!==d[b].dataSeries.type&&"area"!==d[b].dataSeries
.type&&"stepArea"!==d[b].dataSeries.type||(a?d[b].distance<=a.distance&&(a=d[b]):a=d[b])
;return a};A.prototype.getObjectAtXY=function(a,c,b){var d=

null;if(b=this.getDataPointAtXY(a,c,b||!1))d=b.dataSeries.dataPointIds[b.dataPointIndex];els
e if(v)d=Ma(a,c,this._eventManager.ghostCtx);else
for(b=0;b<this.legend.items.length;b++){var
f=this.legend.items[b];a>=f.x1&&(a<=f.x2&&c>=f.y1&&c<=f.y2)&&(d=f.id)}return
d};A.prototype.getAutoFontSize=function(a,c,b){a/=400;return
Math.max(10,Math.round(Math.min(this.width,this.height)*a))};A.prototype.resetOverlayed
Canvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};A.prototype
.clearCanvas=

function(){this.ctx.clearRect(0,0,this.width,this.height);this.backgroundColor&&(this.ctx.fill
Style=this.backgroundColor,this.ctx.fillRect(0,0,this.width,this.height))};A.prototype.attachE
vent=function(a){this._events.push(a)};A.prototype._touchEventHandler=function(a){if(a.ch
angedTouches&&this.interactivityEnabled){var
c=[],b=a.changedTouches,d=b?b[0]:a,f=null;switch(a.type){case "touchstart":case
"MSPointerDown":c=["mousemove","mousedown"];this._lastTouchData=ya(d);this._lastTou
chData.time=new Date;

break;case "touchmove":case "MSPointerMove":c=["mousemove"];break;case


"touchend":case
"MSPointerUp":c="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._la
stTouchEventType?["mouseup","click"]:["mouseup"];break;default:return}if(!(b&&1<b.leng
th)){f=ya(d);f.time=new Date;try{var g=f.y-this._lastTouchData.y,h=f.time-
this._lastTouchData.time;if(15<Math.abs(g)&&(this._lastTouchData.scroll||200>h)){this._las
tTouchData.scroll=!0;var k=window.parent||window;k&&k.scrollBy&&k.scrollBy(0,-
g)}}catch(l){}this._lastTouchEventType=

119
Chatbot designing

a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedC
anvas(),this.isDrag=!1;else
for(b=0;b<c.length;b++)f=c[b],g=document.createEvent("MouseEvent"),g.initMouseEvent(f,
!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),d.target.dispatchE
vent(g),a.preventManipulation&&a.preventManipulation(),a.preventDefault&&a.preventDef
ault()}}};A.prototype._dispatchRangeEvent=function(a,c){var
b={chart:this};b.type=a;b.trigger=c;var d=[];this.axisX&&0<this.axisX.length&&

d.push("axisX");this.axisX2&&0<this.axisX2.length&&d.push("axisX2");this.axisY&&0<th
is.axisY.length&&d.push("axisY");this.axisY2&&0<this.axisY2.length&&d.push("axisY2");
for(var f=0;f<d.length;f++)if(x(b[d[f]])&&(b[d[f]]=[]),"axisY"===d[f])for(var
g=0;g<this.axisY.length;g++)b[d[f]].push({viewportMinimum:this[d[f]][g].sessionVariables.
newViewportMinimum,viewportMaximum:this[d[f]][g].sessionVariables.newViewportMaxi
mum});else
if("axisY2"===d[f])for(g=0;g<this.axisY2.length;g++)b[d[f]].push({viewportMinimum:this[
d[f]][g].sessionVariables.newViewportMinimum,

viewportMaximum:this[d[f]][g].sessionVariables.newViewportMaximum});else
if("axisX"===d[f])for(g=0;g<this.axisX.length;g++)b[d[f]].push({viewportMinimum:this[d[f
]][g].sessionVariables.newViewportMinimum,viewportMaximum:this[d[f]][g].sessionVariab
les.newViewportMaximum});else
if("axisX2"===d[f])for(g=0;g<this.axisX2.length;g++)b[d[f]].push({viewportMinimum:this[
d[f]][g].sessionVariables.newViewportMinimum,viewportMaximum:this[d[f]][g].sessionVari
ables.newViewportMaximum});this.dispatchEvent(a,b,this)};

A.prototype._mouseEventHandler=function(a){"undefined"===typeof
a.target&&a.srcElement&&(a.target=a.srcElement);var
c=ya(a),b=a.type,d,f;a.which?f=3==a.which:a.button&&(f=2==a.button);A.capturedEventPar
am&&(d=A.capturedEventParam,"mouseup"===b&&(A.capturedEventParam=null,d.chart.o
verlaidCanvas.releaseCapture?d.chart.overlaidCanvas.releaseCapture():document.documentE
lement.removeEventListener("mouseup",d.chart._mouseEventHandler,!1)),d.hasOwnPropert
y(b)&&("mouseup"!==b||d.chart.overlaidCanvas.releaseCapture?

a.target===d.chart.overlaidCanvas&&d[b].call(d.context,c.x,c.y):a.target!==d.chart.overlaid
Canvas&&(d.chart.isDrag=!1)));if(this.interactivityEnabled)if(this._ignoreNextEvent)this._ig
noreNextEvent=!1;else

120
Chatbot designing

if(a.preventManipulation&&a.preventManipulation(),a.preventDefault&&a.preventDefault(),
!f){if(!A.capturedEventParam&&this._events){for(var
g=0;g<this._events.length;g++)if(this._events[g].hasOwnProperty(b))if(d=this._events[g],f=d
.bounds,c.x>=f.x1&&c.x<=f.x2&&c.y>=f.y1&&c.y<=f.y2){d[b].call(d.context,

c.x,c.y);"mousedown"===b&&!0===d.capture?(A.capturedEventParam=d,this.overlaidCanv
as.setCapture?this.overlaidCanvas.setCapture():document.documentElement.addEventListen
er("mouseup",this._mouseEventHandler,!1)):"mouseup"===b&&(d.chart.overlaidCanvas.rel
easeCapture?d.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEv
entListener("mouseup",this._mouseEventHandler,!1));break}else
d=null;a.target.style.cursor=d&&d.cursor?d.cursor:this._defaultCursor}b=this.plotArea;if(c.x
<b.x1||c.x>

b.x2||c.y<b.y1||c.y>b.y2)this.toolTip&&this.toolTip.enabled?this.toolTip.hide():this.resetOve
rlayedCanvas();this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.m
ouseEventHandler(a)}};A.prototype._plotAreaMouseDown=function(a,c){this.isDrag=!0;thi
s.dragStartPoint={x:a,y:c}};A.prototype._plotAreaMouseUp=function(a,c){if(("normal"===t
his.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var
b=c-this.dragStartPoint.y,d=a-this.dragStartPoint.x,f=0<=this.zoomType.indexOf("x"),

g=0<=this.zoomType.indexOf("y"),h=!1;this.resetOverlayedCanvas();if("xySwapped"===thi
s.plotInfo.axisPlacement)var
k=g,g=f,f=k;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(f=g=0;f<this._axe
s.length;f++)b=this._axes[f],b.logarithmic?b.viewportMinimum<b.minimum?(g=b.minimum/
b.viewportMinimum,b.sessionVariables.newViewportMinimum=b.viewportMinimum*g,b.se
ssionVariables.newViewportMaximum=b.viewportMaximum*g,h=!0):b.viewportMaximum>
b.maximum&&(g=b.viewportMaximum/b.maximum,b.sessionVariables.newViewportMinim
um=

b.viewportMinimum/g,b.sessionVariables.newViewportMaximum=b.viewportMaximum/g,h
=!0):b.viewportMinimum<b.minimum?(g=b.minimum-
b.viewportMinimum,b.sessionVariables.newViewportMinimum=b.viewportMinimum+g,b.se
ssionVariables.newViewportMaximum=b.viewportMaximum+g,h=!0):b.viewportMaximum
>b.maximum&&(g=b.viewportMaximum-
b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum-
g,b.sessionVariables.newViewportMaximum=b.viewportMaximum-g,h=!0);else

121
Chatbot designing

if((!f||2<Math.abs(d))&&(!g||2<Math.abs(b))&&this.zoomEnabled){if(!this.dragStartPoint)re
turn;

b=f?this.dragStartPoint.x:this.plotArea.x1;d=g?this.dragStartPoint.y:this.plotArea.y1;f=f?a:th
is.plotArea.x2;g=g?c:this.plotArea.y2;2<Math.abs(b-f)&&2<Math.abs(d-
g)&&this._zoomPanToSelectedRegion(b,d,f,g)&&(h=!0)}h&&(this._ignoreNextEvent=!0,th
is._dispatchRangeEvent("rangeChanging","zoom"),this.render(),this._dispatchRangeEvent("r
angeChanged","zoom"),h&&(this.zoomEnabled&&"none"===this._zoomButton.style.displa
y)&&(ua(this._zoomButton,this._resetButton),T(this,this._zoomButton,"pan"),T(this,this._re
setButton,

"reset")))}}this.isDrag=!1};A.prototype._plotAreaMouseMove=function(a,c){if(this.isDrag&
&"none"!==this.plotInfo.axisPlacement){var
b=0,d=0,f=b=null,f=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),h=t
his;"xySwapped"===this.plotInfo.axisPlacement&&(b=g,g=f,f=b);b=this.dragStartPoint.x-
a;d=this.dragStartPoint.y-
c;2<Math.abs(b)&&8>Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this.toolTip.hide
():this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,c);if((!f||2<Math.abs
(b)||

!g||2<Math.abs(d))&&(this.panEnabled||this.zoomEnabled))if(this.panEnabled)f={x1:f?this.p
lotArea.x1+b:this.plotArea.x1,y1:g?this.plotArea.y1+d:this.plotArea.y1,x2:f?this.plotArea.x2
+b:this.plotArea.x2,y2:g?this.plotArea.y2+d:this.plotArea.y2},clearTimeout(h._panTimerId),
h._panTimerId=setTimeout(function(b,d,e,f){return
function(){h._zoomPanToSelectedRegion(b,d,e,f,!0)&&(h._dispatchRangeEvent("rangeChan
ging","pan"),h.render(),h._dispatchRangeEvent("rangeChanged","pan"),h.dragStartPoint.x=a,
h.dragStartPoint.y=

c)}}(f.x1,f.y1,f.x2,f.y2),0);else
if(this.zoomEnabled){this.resetOverlayedCanvas();b=this.overlaidCanvasCtx.globalAlpha;thi
s.overlaidCanvasCtx.fillStyle="#A89896";var
d=f?this.dragStartPoint.x:this.plotArea.x1,k=g?this.dragStartPoint.y:this.plotArea.y1,l=f?a-
this.dragStartPoint.x:this.plotArea.x2-this.plotArea.x1,m=g?c-
this.dragStartPoint.y:this.plotArea.y2-
this.plotArea.y1;this.validateRegion(d,k,f?a:this.plotArea.x2-
this.plotArea.x1,g?c:this.plotArea.y2-this.plotArea.y1,"xy"!==this.zoomType).isValid&&

122
Chatbot designing

(this.resetOverlayedCanvas(),this.overlaidCanvasCtx.fillStyle="#99B2B5");this.overlaidCan
vasCtx.globalAlpha=0.7;this.overlaidCanvasCtx.fillRect(d,k,l,m);this.overlaidCanvasCtx.glo
balAlpha=b}}else
this.toolTip.mouseMoveHandler(a,c)};A.prototype._zoomPanToSelectedRegion=function(a,
c,b,d,f){a=this.validateRegion(a,c,b,d,f);c=a.axesWithValidRange;b=a.axesRanges;if(a.isVali
d)for(d=0;d<c.length;d++)f=b[d],c[d].setViewPortRange(f.val1,f.val2);return
a.isValid};A.prototype.validateRegion=function(a,c,b,d,

f){f=f||!1;for(var
g=0<=this.zoomType.indexOf("x"),h=0<=this.zoomType.indexOf("y"),k=!1,l=[],m=[],n=[],p
=0;p<this.axisX.length;p++)this.axisX[p]&&g&&m.push(this.axisX[p]);for(p=0;p<this.axis
X2.length;p++)this.axisX2[p]&&g&&m.push(this.axisX2[p]);for(p=0;p<this.axisY.length;p+
+)this.axisY[p]&&h&&m.push(this.axisY[p]);for(p=0;p<this.axisY2.length;p++)this.axisY2[
p]&&h&&m.push(this.axisY2[p]);for(g=0;g<m.length;g++){var
h=m[g],p=h.convertPixelToValue({x:a,y:c}),e=h.convertPixelToValue({x:b,y:d});if(p>

e)var
r=e,e=p,p=r;if(isFinite(h.dataInfo.minDiff))if(!(h.logarithmic&&e/p<Math.pow(h.dataInfo.m
inDiff,3)||!h.logarithmic&&Math.abs(e-
p)<3*Math.abs(h.dataInfo.minDiff)||p<h.minimum||e>h.maximum))l.push(h),n.push({val1:p,
val2:e}),k=!0;else
if(!f){k=!1;break}}return{isValid:k,axesWithValidRange:l,axesRanges:n}};A.prototype.prep
arePlotArea=function(){var
a=this.plotArea;!v&&(0<a.x1||0<a.y1)&&a.ctx.translate(a.x1,a.y1);if((this.axisX[0]||this.axis
X2[0])&&(this.axisY[0]||this.axisY2[0])){var c=this.axisX[0]?

this.axisX[0].lineCoordinates:this.axisX2[0].lineCoordinates;if(this.axisY&&0<this.axisY.le
ngth&&this.axisY[0]){var
b=this.axisY[0];a.x1=c.x1<c.x2?c.x1:b.lineCoordinates.x1;a.y1=c.y1<b.lineCoordinates.y1?c
.y1:b.lineCoordinates.y1;a.x2=c.x2>b.lineCoordinates.x2?c.x2:b.lineCoordinates.x2;a.y2=c.y
2>c.y1?c.y2:b.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-
a.y1}this.axisY2&&0<this.axisY2.length&&this.axisY2[0]&&(b=this.axisY2[0],a.x1=c.x1<
c.x2?c.x1:b.lineCoordinates.x1,a.y1=c.y1<b.lineCoordinates.y1?

c.y1:b.lineCoordinates.y1,a.x2=c.x2>b.lineCoordinates.x2?c.x2:b.lineCoordinates.x2,a.y2=c.
y2>c.y1?c.y2:b.lineCoordinates.y2,a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else

123
Chatbot designing

c=this.layoutManager.getFreeSpace(),a.x1=c.x1,a.x2=c.x2,a.y1=c.y1,a.y2=c.y2,a.width=c.wi
dth,a.height=c.height;v||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=
a.x1+"px",a.canvas.style.top=a.y1+"px",(0<a.x1||0<a.y1)&&a.ctx.translate(-a.x1,-
a.y1));a.layoutManager=new ia(a.x1,a.y1,a.x2,a.y2,2)};A.prototype.renderIndexLabels=

function(a){var
c=a||this.plotArea.ctx,b=this.plotArea,d=0,f=0,g=0,h=0,k=d=h=f=g=0,l=0;for(a=0;a<this._in
dexLabels.length;a++){var
m=this._indexLabels[a],n=m.chartType.toLowerCase(),p,e,k=L("indexLabelFontColor",m.da
taPoint,m.dataSeries),l=L("indexLabelFontSize",m.dataPoint,m.dataSeries);p=L("indexLabel
FontFamily",m.dataPoint,m.dataSeries);e=L("indexLabelFontStyle",m.dataPoint,m.dataSerie
s);var
h=L("indexLabelFontWeight",m.dataPoint,m.dataSeries),r=L("indexLabelBackgroundColor"
,m.dataPoint,m.dataSeries),

f=L("indexLabelMaxWidth",m.dataPoint,m.dataSeries),g=L("indexLabelWrap",m.dataPoint,
m.dataSeries),q=L("indexLabelLineDashType",m.dataPoint,m.dataSeries),s=L("indexLabelL
ineColor",m.dataPoint,m.dataSeries),u=x(m.dataPoint.indexLabelLineThickness)?x(m.dataSe
ries.options.indexLabelLineThickness)?0:m.dataSeries.options.indexLabelLineThickness:m.d
ataPoint.indexLabelLineThickness,d=0<u?Math.min(10,("normal"===this.plotInfo.axisPlace
ment?this.plotArea.height:this.plotArea.width)<<0):0,w={percent:null,total:null},

y=null;if(0<=m.dataSeries.type.indexOf("stacked")||"pie"===m.dataSeries.type||"doughnut"=
==m.dataSeries.type)w=this.getPercentAndTotal(m.dataSeries,m.dataPoint);if(m.dataSeries.i
ndexLabelFormatter||m.dataPoint.indexLabelFormatter)y={chart:this,dataSeries:m.dataSeries
,dataPoint:m.dataPoint,index:m.indexKeyword,total:w.total,percent:w.percent};var
t=m.dataPoint.indexLabelFormatter?m.dataPoint.indexLabelFormatter(y):m.dataPoint.index
Label?this.replaceKeywordsWithValue(m.dataPoint.indexLabel,m.dataPoint,

m.dataSeries,null,m.indexKeyword):m.dataSeries.indexLabelFormatter?m.dataSeries.indexL
abelFormatter(y):m.dataSeries.indexLabel?this.replaceKeywordsWithValue(m.dataSeries.ind
exLabel,m.dataPoint,m.dataSeries,null,m.indexKeyword):null;if(null!==t&&""!==t){var
w=L("indexLabelPlacement",m.dataPoint,m.dataSeries),y=L("indexLabelOrientation",m.data
Point,m.dataSeries),D=m.direction,Z=m.dataSeries.axisX,ja=m.dataSeries.axisY,z=!1,r=new
W(c,{x:0,y:0,maxWidth:f?f:0.5*this.width,maxHeight:g?5*l:1.5*l,angle:"horizontal"===

124
Chatbot designing

y?0:-
90,text:t,padding:0,backgroundColor:r,horizontalAlign:"left",fontSize:l,fontFamily:p,fontWei
ght:h,fontColor:k,fontStyle:e,textBaseline:"top"});r.measureText();m.dataSeries.indexLabel
MaxWidth=r.maxWidth;if(0<=n.indexOf("line")||0<=n.indexOf("area")||0<=n.indexOf("bubb
le")||0<=n.indexOf("scatter")){if(m.dataPoint.x<Z.viewportMinimum||m.dataPoint.x>Z.view
portMaximum||m.dataPoint.y<ja.viewportMinimum||m.dataPoint.y>ja.viewportMaximum)co
ntinue}else if(0<=n.indexOf("column")){if(m.dataPoint.x<Z.viewportMinimum||

m.dataPoint.x>Z.viewportMaximum||m.bounds.y1>b.y2||m.bounds.y2<b.y1)continue}else
if(0<=n.indexOf("bar")){if(m.dataPoint.x<Z.viewportMinimum||m.dataPoint.x>Z.viewportM
aximum||m.bounds.x1>b.x2||m.bounds.x2<b.x1)continue}else
if(m.dataPoint.x<Z.viewportMinimum||m.dataPoint.x>Z.viewportMaximum)continue;f=h=2;
"horizontal"===y?(k=r.width,l=r.height):(l=r.width,k=r.height);if("normal"===this.plotInfo.a
xisPlacement){if(0<=n.indexOf("line")||0<=n.indexOf("area"))w="auto",h=4;else
if(0<=n.indexOf("stacked"))"auto"===

w&&(w="inside");else if("bubble"===n||"scatter"===n)w="inside";p=m.point.x-
k/2;"inside"!==w?(f=b.y1,g=b.y2,0<D?(e=m.point.y-l-h-
d,e<f&&(e="auto"===w?Math.max(m.point.y,f)+h+d:f+h+d,z=e+l>m.point.y)):(e=m.point.y
+h+d,e>g-l-h-d&&(e="auto"===w?Math.min(m.point.y,g)-l-h-d:g-l-h-
d,z=e<m.point.y))):(f=Math.max(m.bounds.y1,b.y1),g=Math.min(m.bounds.y2,b.y2),d=0<=n
.indexOf("range")?0<D?Math.max(m.bounds.y1,b.y1)+l/2+h:Math.min(m.bounds.y2,b.y2)-
l/2-h:(Math.max(m.bounds.y1,b.y1)+Math.min(m.bounds.y2,b.y2))/

2,0<D?(e=Math.max(m.point.y,d)-
l/2,e<f&&("bubble"===n||"scatter"===n)&&(e=Math.max(m.point.y-l-
h,b.y1+h))):(e=Math.min(m.point.y,d)-l/2,e>g-l-
h&&("bubble"===n||"scatter"===n)&&(e=Math.min(m.point.y+h,b.y2-l-
h))),e=Math.min(e,g-l))}else
0<=n.indexOf("line")||0<=n.indexOf("area")||0<=n.indexOf("scatter")?(w="auto",f=4):0<=n.i
ndexOf("stacked")?"auto"===w&&(w="inside"):"bubble"===n&&(w="inside"),e=m.point.y
-l/2,"inside"!==w?(h=b.x1,g=b.x2,0>D?(p=m.point.x-k-f-
d,p<h&&(p="auto"===w?Math.max(m.point.x,h)+

f+d:h+f+d,z=p+k>m.point.x)):(p=m.point.x+f+d,p>g-k-f-
d&&(p="auto"===w?Math.min(m.point.x,g)-k-f-d:g-k-f-

125
Chatbot designing

d,z=p<m.point.x))):(h=Math.max(m.bounds.x1,b.x1),Math.min(m.bounds.x2,b.x2),d=0<=n.i
ndexOf("range")?0>D?Math.max(m.bounds.x1,b.x1)+k/2+f:Math.min(m.bounds.x2,b.x2)-
k/2-
f:(Math.max(m.bounds.x1,b.x1)+Math.min(m.bounds.x2,b.x2))/2,p=0>D?Math.max(m.point.
x,d)-k/2:Math.min(m.point.x,d)-
k/2,p=Math.max(p,h));"vertical"===y&&(e+=l);r.x=p;r.y=e;r.render(!0);u&&("inside"!==w
&&(0>n.indexOf("bar")&&m.point.x>

b.x1&&m.point.x<b.x2||!z)&&(0>n.indexOf("column")&&m.point.y>b.y1&&m.point.y<b.y
2||!z))&&(c.lineWidth=u,c.strokeStyle=s?s:"gray",c.setLineDash&&c.setLineDash(I(q,u)),c.
beginPath(),c.moveTo(m.point.x,m.point.y),0<=n.indexOf("bar")?c.lineTo(p+(0<m.direction
?0:k),e+("horizontal"===y?l:-
l)/2):0<=n.indexOf("column")?c.lineTo(p+k/2,e+((0<m.direction?l:-l)+("horizontal"===y?l:-
l))/2):c.lineTo(p+k/2,e+((e<m.point.y?l:-l)+("horizontal"===y?l:-
l))/2),c.stroke())}}c={source:c,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,

easingFunction:F.easing.easeInQuad,animationBase:0,startTimePercent:0.7};for(a=0;a<this._
indexLabels.length;a++)m=this._indexLabels[a],r=L("indexLabelBackgroundColor",m.dataP
oint,m.dataSeries),m.dataSeries.indexLabelBackgroundColor=x(r)?v?"transparent":null:r;retu
rn c};A.prototype.renderLine=function(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=this._eventManager.ghostCtx;c.save();var
d=this.plotArea;c.beginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();

for(var d=[],f=null,g=0;g<a.dataSeriesIndexes.length;g++){var
h=a.dataSeriesIndexes[g],k=this.data[h];c.lineWidth=k.lineThickness;var
l=k.dataPoints,m="solid";if(c.setLineDash){var
n=I(k.nullDataLineDashType,k.lineThickness),m=k.lineDashType,p=I(m,k.lineThickness);c.
setLineDash(p)}var
e=k.id;this._eventManager.objectMap[e]={objectType:"dataSeries",dataSeriesIndex:h};e=G(
e);b.strokeStyle=e;b.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var
e=k._colorSet,r=e=k.lineColor=k.options.lineColor?

k.options.lineColor:e[0];c.strokeStyle=e;var
q=!0,s=0,u,w;c.beginPath();if(0<l.length){for(var
y=!1,s=0;s<l.length;s++)if(u=l[s].x.getTime?l[s].x.getTime():l[s].x,!(u<a.axisX.dataInfo.view

126
Chatbot designing

PortMin||u>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!y)))if("number"!==typeo
f
l[s].y)0<s&&!(k.connectNullData||y||q)&&(c.stroke(),v&&b.stroke()),y=!0;else{u=a.axisX.c
onvertValueToPixel(u);w=a.axisY.convertValueToPixel(l[s].y);var
t=k.dataPointIds[s];this._eventManager.objectMap[t]={id:t,objectType:"dataPoint",

dataSeriesIndex:h,dataPointIndex:s,x1:u,y1:w};q||y?(!q&&k.connectNullData?(c.setLineDas
h&&(k.options.nullDataLineDashType||m===k.lineDashType&&k.lineDashType!==k.nullD
ataLineDashType)&&(c.stroke(),m=k.nullDataLineDashType,c.setLineDash(n)),c.lineTo(u,
w),v&&b.lineTo(u,w)):(c.beginPath(),c.moveTo(u,w),v&&(b.beginPath(),b.moveTo(u,w))),y
=q=!1):(c.lineTo(u,w),v&&b.lineTo(u,w),0==s%500&&(c.stroke(),c.beginPath(),c.moveTo(
u,w),v&&(b.stroke(),b.beginPath(),b.moveTo(u,w))));s<l.length-1&&(r!==(l[s].lineColor||

e)||m!==(l[s].lineDashType||k.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(u,w),r=l
[s].lineColor||e,c.strokeStyle=r,c.setLineDash&&(l[s].lineDashType?(m=l[s].lineDashType,c.
setLineDash(I(m,k.lineThickness))):(m=k.lineDashType,c.setLineDash(p))));if(0<l[s].marker
Size||0<k.markerSize){var
D=k.getMarkerProperties(s,u,w,c),f=D.color;d.push(D);t=G(t);v&&d.push({x:u,y:w,ctx:b,typ
e:D.type,size:D.size,color:t,borderColor:t,borderThickness:D.borderThickness})}(l[s].indexL
abel||k.indexLabel||l[s].indexLabelFormatter||

k.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",dataPoint:l[s],dataSerie
s:k,point:{x:u,y:w},direction:0>l[s].y===a.axisY.reversed?1:-
1,color:e})}c.stroke();v&&b.stroke()}}P.drawMarkers(d);k.markerColor=f;c.restore();c.begi
nPath();v&&b.beginPath();return{source:c,dest:this.plotArea.ctx,animationCallback:F.xClip
Animation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStepLine=f
unction(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=

this._eventManager.ghostCtx;c.save();var
d=this.plotArea;c.beginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();for(var
d=[],f=null,g=0;g<a.dataSeriesIndexes.length;g++){var
h=a.dataSeriesIndexes[g],k=this.data[h];c.lineWidth=k.lineThickness;var
l=k.dataPoints,m="solid";if(c.setLineDash){var
n=I(k.nullDataLineDashType,k.lineThickness),m=k.lineDashType,p=I(m,k.lineThickness);c.
setLineDash(p)}var

127
Chatbot designing

e=k.id;this._eventManager.objectMap[e]={objectType:"dataSeries",dataSeriesIndex:h};e=G(
e);b.strokeStyle=

e;b.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var
e=k._colorSet,r=e=k.lineColor=k.options.lineColor?k.options.lineColor:e[0];c.strokeStyle=e;
var q=!0,s=0,u,w;c.beginPath();if(0<l.length){for(var
y=!1,s=0;s<l.length;s++)if(u=l[s].getTime?l[s].x.getTime():l[s].x,!(u<a.axisX.dataInfo.viewP
ortMin||u>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!y)))if("number"!==typeof
l[s].y)0<s&&!(k.connectNullData||y||q)&&(c.stroke(),v&&b.stroke()),y=!0;else{var
t=w;u=a.axisX.convertValueToPixel(u);

w=a.axisY.convertValueToPixel(l[s].y);var
D=k.dataPointIds[s];this._eventManager.objectMap[D]={id:D,objectType:"dataPoint",dataSe
riesIndex:h,dataPointIndex:s,x1:u,y1:w};q||y?(!q&&k.connectNullData?(c.setLineDash&&(k
.options.nullDataLineDashType||m===k.lineDashType&&k.lineDashType!==k.nullDataLine
DashType)&&(c.stroke(),m=k.nullDataLineDashType,c.setLineDash(n)),c.lineTo(u,t),c.lineT
o(u,w),v&&(b.lineTo(u,t),b.lineTo(u,w))):(c.beginPath(),c.moveTo(u,w),v&&(b.beginPath(),
b.moveTo(u,w))),y=q=!1):(c.lineTo(u,

t),v&&b.lineTo(u,t),c.lineTo(u,w),v&&b.lineTo(u,w),0==s%500&&(c.stroke(),c.beginPath()
,c.moveTo(u,w),v&&(b.stroke(),b.beginPath(),b.moveTo(u,w))));s<l.length-
1&&(r!==(l[s].lineColor||e)||m!==(l[s].lineDashType||k.lineDashType))&&(c.stroke(),c.begin
Path(),c.moveTo(u,w),r=l[s].lineColor||e,c.strokeStyle=r,c.setLineDash&&(l[s].lineDashType
?(m=l[s].lineDashType,c.setLineDash(I(m,k.lineThickness))):(m=k.lineDashType,c.setLineD
ash(p))));if(0<l[s].markerSize||0<k.markerSize)t=k.getMarkerProperties(s,u,w,

c),f=t.color,d.push(t),D=G(D),v&&d.push({x:u,y:w,ctx:b,type:t.type,size:t.size,color:D,borde
rColor:D,borderThickness:t.borderThickness});(l[s].indexLabel||k.indexLabel||l[s].indexLabe
lFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoi
nt:l[s],dataSeries:k,point:{x:u,y:w},direction:0>l[s].y===a.axisY.reversed?1:-
1,color:e})}c.stroke();v&&b.stroke()}}P.drawMarkers(d);k.markerColor=f;c.restore();c.begi
nPath();v&&b.beginPath();return{source:c,dest:this.plotArea.ctx,

animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.
prototype.renderSpline=function(a){function
c(a){a=va(a,2);if(0<a.length){b.beginPath();v&&d.beginPath();b.moveTo(a[0].x,a[0].y);a[0].

128
Chatbot designing

newStrokeStyle&&(b.strokeStyle=a[0].newStrokeStyle);a[0].newLineDashArray&&b.setLin
eDash(a[0].newLineDashArray);v&&d.moveTo(a[0].x,a[0].y);for(var c=0;c<a.length-
3;c+=3)if(b.bezierCurveTo(a[c+1].x,a[c+1].y,a[c+2].x,a[c+2].y,a[c+3].x,a[c+3].y),v&&d.bez
ierCurveTo(a[c+1].x,a[c+1].y,

a[c+2].x,a[c+2].y,a[c+3].x,a[c+3].y),0<c&&0===c%3E3||a[c+3].newStrokeStyle||a[c+3].new
LineDashArray)b.stroke(),b.beginPath(),b.moveTo(a[c+3].x,a[c+3].y),a[c+3].newStrokeStyle
&&(b.strokeStyle=a[c+3].newStrokeStyle),a[c+3].newLineDashArray&&b.setLineDash(a[c
+3].newLineDashArray),v&&(d.stroke(),d.beginPath(),d.moveTo(a[c+3].x,a[c+3].y));b.strok
e();v&&d.stroke()}}var
b=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
d=this._eventManager.ghostCtx;b.save();var f=this.plotArea;

b.beginPath();b.rect(f.x1,f.y1,f.width,f.height);b.clip();for(var
f=[],g=null,h=0;h<a.dataSeriesIndexes.length;h++){var
k=a.dataSeriesIndexes[h],l=this.data[k];b.lineWidth=l.lineThickness;var
m=l.dataPoints,n="solid";if(b.setLineDash){var
p=I(l.nullDataLineDashType,l.lineThickness),n=l.lineDashType,e=I(n,l.lineThickness);b.setL
ineDash(e)}var
r=l.id;this._eventManager.objectMap[r]={objectType:"dataSeries",dataSeriesIndex:k};r=G(r)
;d.strokeStyle=r;d.lineWidth=0<l.lineThickness?Math.max(l.lineThickness,

4):0;var
r=l._colorSet,q=r=l.lineColor=l.options.lineColor?l.options.lineColor:r[0];b.strokeStyle=r;var
s=0,u,w,y=[];b.beginPath();if(0<m.length)for(w=!1,s=0;s<m.length;s++)if(u=m[s].getTime?
m[s].x.getTime():m[s].x,!(u<a.axisX.dataInfo.viewPortMin||u>a.axisX.dataInfo.viewPortMax
&&(!l.connectNullData||!w)))if("number"!==typeof
m[s].y)0<s&&!w&&(l.connectNullData?b.setLineDash&&(0<y.length&&(l.options.nullDat
aLineDashType||!m[s-1].lineDashType))&&(y[y.length-
1].newLineDashArray=p,n=l.nullDataLineDashType):

(c(y),y=[])),w=!0;else{u=a.axisX.convertValueToPixel(u);w=a.axisY.convertValueToPixel(
m[s].y);var
t=l.dataPointIds[s];this._eventManager.objectMap[t]={id:t,objectType:"dataPoint",dataSeries
Index:k,dataPointIndex:s,x1:u,y1:w};y[y.length]={x:u,y:w};s<m.length-
1&&(q!==(m[s].lineColor||r)||n!==(m[s].lineDashType||l.lineDashType))&&(q=m[s].lineCol

129
Chatbot designing

or||r,y[y.length-
1].newStrokeStyle=q,b.setLineDash&&(m[s].lineDashType?(n=m[s].lineDashType,y[y.lengt
h-1].newLineDashArray=I(n,l.lineThickness)):(n=l.lineDashType,

y[y.length-1].newLineDashArray=e)));if(0<m[s].markerSize||0<l.markerSize){var
D=l.getMarkerProperties(s,u,w,b),g=D.color;f.push(D);t=G(t);v&&f.push({x:u,y:w,ctx:d,typ
e:D.type,size:D.size,color:t,borderColor:t,borderThickness:D.borderThickness})}(m[s].index
Label||l.indexLabel||m[s].indexLabelFormatter||l.indexLabelFormatter)&&this._indexLabels.
push({chartType:"spline",dataPoint:m[s],dataSeries:l,point:{x:u,y:w},direction:0>m[s].y===
a.axisY.reversed?1:-1,color:r});w=!1}c(y)}P.drawMarkers(f);l.markerColor=

g;b.restore();b.beginPath();v&&d.beginPath();return{source:b,dest:this.plotArea.ctx,animatio
nCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};var
N=function(a,c,b,d,f,g,h,k,l,m,n,p,e){"undefined"===typeof
e&&(e=1);h=h||0;k=k||"black";var r=15<d-c&&15<f-b?8:0.35*Math.min(d-c,f-
b);a.beginPath();a.moveTo(c,b);a.save();a.fillStyle=g;a.globalAlpha=e;a.fillRect(c,b,d-c,f-
b);a.globalAlpha=1;0<h&&(e=0===h%2?0:0.5,a.beginPath(),a.lineWidth=h,a.strokeStyle=k,
a.moveTo(c,b),a.rect(c-

e,b-e,d-c+2*e,f-
b+2*e),a.stroke());a.restore();!0===l&&(a.save(),a.beginPath(),a.moveTo(c,b),a.lineTo(c+r,b
+r),a.lineTo(d-
r,b+r),a.lineTo(d,b),a.closePath(),h=a.createLinearGradient((d+c)/2,b+r,(d+c)/2,b),h.addColo
rStop(0,g),h.addColorStop(1,"rgba(255, 255, 255,
.4)"),a.fillStyle=h,a.fill(),a.restore());!0===m&&(a.save(),a.beginPath(),a.moveTo(c,f),a.line
To(c+r,f-r),a.lineTo(d-r,f-r),a.lineTo(d,f),a.closePath(),h=a.createLinearGradient((d+c)/2,f-
r,(d+c)/2,f),h.addColorStop(0,g),h.addColorStop(1,"rgba(255, 255, 255, .4)"),

a.fillStyle=h,a.fill(),a.restore());!0===n&&(a.save(),a.beginPath(),a.moveTo(c,b),a.lineTo(c+
r,b+r),a.lineTo(c+r,f-
r),a.lineTo(c,f),a.closePath(),h=a.createLinearGradient(c+r,(f+b)/2,c,(f+b)/2),h.addColorStop
(0,g),h.addColorStop(1,"rgba(255, 255, 255,
0.1)"),a.fillStyle=h,a.fill(),a.restore());!0===p&&(a.save(),a.beginPath(),a.moveTo(d,b),a.line
To(d-r,b+r),a.lineTo(d-r,f-r),a.lineTo(d,f),h=a.createLinearGradient(d-
r,(f+b)/2,d,(f+b)/2),h.addColorStop(0,g),h.addColorStop(1,"rgba(255, 255, 255, 0.1)"),

130
Chatbot designing

a.fillStyle=h,h.addColorStop(0,g),h.addColorStop(1,"rgba(255, 255, 255,


0.1)"),a.fillStyle=h,a.fill(),a.closePath(),a.restore())};A.prototype.renderColumn=function(a){
var c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=null,d=this.plotArea,f=0,g,h,k,l=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axis
Y.viewportMinimum:0),f=this.dataPointMinWidth=this.dataPointMinWidth?this.dataPointM
inWidth:this.dataPointWidth?this.dataPointWidth:1,m=this.dataPointMaxWidth=this.dataPoi
ntMaxWidth?

this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.width,
0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0,n=a.axisX.dataInfo.minDiff;isFinit
e(n)||(n=0.3*Math.abs(a.axisX.range));n=this.dataPointWidth=this.dataPointWidth?this.dataP
ointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs
(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>
m&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,

m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&m<f)&&(m=Math.max(this.dat
aPointWidth?this.dataPointWidth:-
Infinity,f));n<f&&(n=f);n>m&&(n=m);c.save();v&&this._eventManager.ghostCtx.save();c.b
eginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();v&&(this._eventManager.ghostCtx.begi
nPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.gh
ostCtx.clip());for(d=0;d<a.dataSeriesIndexes.length;d++){var
m=a.dataSeriesIndexes[d],p=this.data[m],e=p.dataPoints;if(0<e.length)for(var r=

5<n&&p.bevelEnabled?!0:!1,f=0;f<e.length;f++)if(e[f].getTime?k=e[f].x.getTime():k=e[f].x,
!(k<a.axisX.dataInfo.viewPortMin||k>a.axisX.dataInfo.viewPortMax)&&"number"===typeo
f
e[f].y){g=a.axisX.convertValueToPixel(k);h=a.axisY.convertValueToPixel(e[f].y);g=a.axisX
.reversed?g+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+d)*n<<0:g-
a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+d)*n<<0;var
q=a.axisX.reversed?g-
n<<0:g+n<<0,s;0<=e[f].y?s=l:(s=h,h=l);h>s&&(b=h,h=s,s=b);b=e[f].color?

e[f].color:p._colorSet[f%p._colorSet.length];N(c,g,h,q,s,b,0,null,r&&0<=e[f].y,0>e[f].y&&r,
!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"
dataPoint",dataSeriesIndex:m,dataPointIndex:f,x1:g,y1:h,x2:q,y2:s};b=G(b);v&&N(this._eve
ntManager.ghostCtx,g,h,q,s,b,0,null,!1,!1,!1,!1);(e[f].indexLabel||p.indexLabel||e[f].indexLab

131
Chatbot designing

elFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",dataPoi
nt:e[f],dataSeries:p,point:{x:g+(q-g)/2,y:0>e[f].y===

a.axisY.reversed?h:s},direction:0>e[f].y===a.axisY.reversed?1:-
1,bounds:{x1:g,y1:Math.min(h,s),x2:q,y2:Math.max(h,s)},color:b})}}c.restore();v&&this._e
ventManager.ghostCtx.restore();a=Math.min(l,a.axisY.bounds.y2);return{source:c,dest:this.p
lotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,ani
mationBase:a}}};A.prototype.renderStackedColumn=function(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=null,d=this.plotArea,f=[],

g=[],h=[],k=0,l,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMini
mum:0),k=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPoi
ntWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.data
PointWidth:0.15*this.width<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.a
xisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?
Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/

a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>n&&(k=Math.min(this.dataP
ointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinW
idth&&n<k)&&(n=Math.max(this.dataPointWidth?this.dataPointWidth:-
Infinity,k));p<k&&(p=k);p>n&&(p=n);c.save();v&&this._eventManager.ghostCtx.save();c.b
eginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();v&&(this._eventManager.ghostCtx.begi
nPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.gh
ostCtx.clip());

for(n=0;n<a.dataSeriesIndexes.length;n++){var
e=a.dataSeriesIndexes[n],r=this.data[e],q=r.dataPoints;if(0<q.length){var
s=5<p&&r.bevelEnabled?!0:!1;c.strokeStyle="#4572A7
";for(k=0;k<q.length;k++)if(b=q[k].x.getTime?q[k].x.getTime():q[k].x,!(b<a.axisX.dataInfo.
viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof q[k].y){var
d=a.axisX.convertValueToPixel(b),u=d-
a.plotType.plotUnits.length*p/2+a.index*p<<0,w=u+p<<0,y;if(a.axisY.logarithmic)h[b]=q[k
].y+(h[b]?h[b]:0),0<h[b]&&(l=a.axisY.convertValueToPixel(h[b]),

132
Chatbot designing

y=f[b]?f[b]:m,f[b]=l);else if(l=a.axisY.convertValueToPixel(q[k].y),0<=q[k].y){var
t=f[b]?f[b]:0;l-=t;y=m-t;f[b]=t+(y-l)}else t=g[b]?g[b]:0,y=l+t,l=m+t,g[b]=t+(y-
l);b=q[k].color?q[k].color:r._colorSet[k%r._colorSet.length];N(c,u,l,w,y,b,0,null,s&&0<=q[k
].y,0>q[k].y&&s,!1,!1,r.fillOpacity);b=r.dataPointIds[k];this._eventManager.objectMap[b]={
id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:k,x1:u,y1:l,x2:w,y2:y};b=G(b)
;v&&N(this._eventManager.ghostCtx,u,l,w,y,b,0,null,!1,!1,!1,!1);(q[k].indexLabel||

r.indexLabel||q[k].indexLabelFormatter||r.indexLabelFormatter)&&this._indexLabels.push({
chartType:"stackedColumn",dataPoint:q[k],dataSeries:r,point:{x:d,y:0<=q[k].y?l:y},direction
:0>q[k].y===a.axisY.reversed?1:-
1,bounds:{x1:u,y1:Math.min(l,y),x2:w,y2:Math.max(l,y)},color:b})}}}c.restore();v&&this._
eventManager.ghostCtx.restore();a=Math.min(m,a.axisY.bounds.y2);return{source:c,dest:this
.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,a
nimationBase:a}}};A.prototype.renderStackedColumn100=

function(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=null,d=this.plotArea,f=[],g=[],h=[],k=0,l,m=a.axisY.convertValueToPixel(a.axisY.logarith
mic?a.axisY.viewportMinimum:0),k=this.dataPointMinWidth?this.dataPointMinWidth:this.d
ataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:th
is.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,p=a.axisX.dataInfo.minDiff;isFin
ite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?

this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range)
:Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxW
idth&&k>n&&(k=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataP
ointMaxWidth&&(this.dataPointMinWidth&&n<k)&&(n=Math.max(this.dataPointWidth?th
is.dataPointWidth:-
Infinity,k));p<k&&(p=k);p>n&&(p=n);c.save();v&&this._eventManager.ghostCtx.save();c.b
eginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();

v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,
d.width,d.height),this._eventManager.ghostCtx.clip());for(n=0;n<a.dataSeriesIndexes.length;
n++){var e=a.dataSeriesIndexes[n],r=this.data[e],q=r.dataPoints;if(0<q.length)for(var
s=5<p&&r.bevelEnabled?!0:!1,k=0;k<q.length;k++)if(b=q[k].x.getTime?q[k].x.getTime():q[

133
Chatbot designing

k].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===t
ypeof q[k].y){d=a.axisX.convertValueToPixel(b);l=0!==a.dataPointYSums[b]?

100*(q[k].y/a.dataPointYSums[b]):0;var u=d-
a.plotType.plotUnits.length*p/2+a.index*p<<0,w=u+p<<0,y;if(a.axisY.logarithmic){h[b]=l+
(h[b]?h[b]:0);if(0>=h[b])continue;l=a.axisY.convertValueToPixel(h[b]);y=f[b]?f[b]:m;f[b]=l
}else if(l=a.axisY.convertValueToPixel(l),0<=q[k].y){var t=f[b]?f[b]:0;l-=t;y=m-t;f[b]=t+(y-
l)}else t=g[b]?g[b]:0,y=l+t,l=m+t,g[b]=t+(y-
l);b=q[k].color?q[k].color:r._colorSet[k%r._colorSet.length];N(c,u,l,w,y,b,0,null,s&&0<=q[k
].y,0>q[k].y&&s,!1,!1,r.fillOpacity);b=r.dataPointIds[k];

this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointI
ndex:k,x1:u,y1:l,x2:w,y2:y};b=G(b);v&&N(this._eventManager.ghostCtx,u,l,w,y,b,0,null,!1,
!1,!1,!1);(q[k].indexLabel||r.indexLabel||q[k].indexLabelFormatter||r.indexLabelFormatter)&
&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:q[k],dataSeries:r,point:
{x:d,y:0<=q[k].y?l:y},direction:0>q[k].y===a.axisY.reversed?1:-
1,bounds:{x1:u,y1:Math.min(l,y),x2:w,y2:Math.max(l,y)},color:b})}}c.restore();v&&this._e
ventManager.ghostCtx.restore();

a=Math.min(m,a.axisY.bounds.y2);return{source:c,dest:this.plotArea.ctx,animationCallback:
F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.r
enderBar=function(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=null,d=this.plotArea,f=0,g,h,k,l=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axis
Y.viewportMinimum:0),f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWi
dth?this.dataPointWidth:1,m=this.dataPointMaxWidth?

this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height
,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0,n=a.axisX.dataInfo.minDiff;isFini
te(n)||(n=0.3*Math.abs(a.axisX.range));n=this.dataPointWidth?this.dataPointWidth:0.9*(d.he
ight*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axis
X.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>m&&(f=Math.min(t
his.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&

(this.dataPointMinWidth&&m<f)&&(m=Math.max(this.dataPointWidth?this.dataPointWidth
:-

134
Chatbot designing

Infinity,f));n<f&&(n=f);n>m&&(n=m);c.save();v&&this._eventManager.ghostCtx.save();c.b
eginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();v&&(this._eventManager.ghostCtx.begi
nPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.gh
ostCtx.clip());for(d=0;d<a.dataSeriesIndexes.length;d++){var
m=a.dataSeriesIndexes[d],p=this.data[m],e=p.dataPoints;if(0<e.length){var
r=5<n&&p.bevelEnabled?

!0:!1;c.strokeStyle="#4572A7
";for(f=0;f<e.length;f++)if(e[f].getTime?k=e[f].x.getTime():k=e[f].x,!(k<a.axisX.dataInfo.vie
wPortMin||k>a.axisX.dataInfo.viewPortMax)&&"number"===typeof
e[f].y){h=a.axisX.convertValueToPixel(k);g=a.axisY.convertValueToPixel(e[f].y);h=a.axisX
.reversed?h+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+d)*n<<0:h-
a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+d)*n<<0;var
q=a.axisX.reversed?h-n<<0:h+n<<0,s;0<=e[f].y?s=l:(s=g,g=l);b=e[f].color?e[f].color:

p._colorSet[f%p._colorSet.length];N(c,s,h,g,q,b,0,null,r,!1,!1,!1,p.fillOpacity);b=p.dataPointI
ds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:m,data
PointIndex:f,x1:s,y1:h,x2:g,y2:q};b=G(b);v&&N(this._eventManager.ghostCtx,s,h,g,q,b,0,nu
ll,!1,!1,!1,!1);(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatte
r)&&this._indexLabels.push({chartType:"bar",dataPoint:e[f],dataSeries:p,point:{x:0<=e[f].y
?g:s,y:h+(q-h)/2},direction:0>e[f].y===a.axisY.reversed?

1:-
1,bounds:{x1:Math.min(s,g),y1:h,x2:Math.max(s,g),y2:q},color:b})}}}c.restore();v&&this._
eventManager.ghostCtx.restore();a=Math.max(l,a.axisX.bounds.x2);return{source:c,dest:this.
plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,a
nimationBase:a}}};A.prototype.renderStackedBar=function(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=null,d=this.plotArea,f=[],g=[],h=[],k=0,l,m=a.axisY.convertValueToPixel(a.axisY.logarith
mic?

a.axisY.viewportMinimum:0),k=this.dataPointMinWidth?this.dataPointMinWidth:this.dataP
ointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.da
taPointWidth?this.dataPointWidth:0.15*this.height<<0,p=a.axisX.dataInfo.minDiff;isFinite(p
)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(d.height

135
Chatbot designing

*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.ra
nge))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&

k>n&&(k=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMa
xWidth&&(this.dataPointMinWidth&&n<k)&&(n=Math.max(this.dataPointWidth?this.data
PointWidth:-
Infinity,k));p<k&&(p=k);p>n&&(p=n);c.save();v&&this._eventManager.ghostCtx.save();c.b
eginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();v&&(this._eventManager.ghostCtx.begi
nPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.gh
ostCtx.clip());for(n=0;n<a.dataSeriesIndexes.length;n++){var e=

a.dataSeriesIndexes[n],r=this.data[e],q=r.dataPoints;if(0<q.length){var
s=5<p&&r.bevelEnabled?!0:!1;c.strokeStyle="#4572A7
";for(k=0;k<q.length;k++)if(b=q[k].x.getTime?q[k].x.getTime():q[k].x,!(b<a.axisX.dataInfo.
viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof q[k].y){var
d=a.axisX.convertValueToPixel(b),u=d-
a.plotType.plotUnits.length*p/2+a.index*p<<0,w=u+p<<0,y;if(a.axisY.logarithmic)h[b]=q[k
].y+(h[b]?h[b]:0),0<h[b]&&(y=f[b]?f[b]:m,f[b]=l=a.axisY.convertValueToPixel(h[b]));else
if(l=

a.axisY.convertValueToPixel(q[k].y),0<=q[k].y){var t=f[b]?f[b]:0;y=m+t;l+=t;f[b]=t+(l-
y)}else t=g[b]?g[b]:0,y=l-t,l=m-t,g[b]=t+(l-
y);b=q[k].color?q[k].color:r._colorSet[k%r._colorSet.length];N(c,y,u,l,w,b,0,null,s,!1,!1,!1,r.f
illOpacity);b=r.dataPointIds[k];this._eventManager.objectMap[b]={id:b,objectType:"dataPoi
nt",dataSeriesIndex:e,dataPointIndex:k,x1:y,y1:u,x2:l,y2:w};b=G(b);v&&N(this._eventMana
ger.ghostCtx,y,u,l,w,b,0,null,!1,!1,!1,!1);(q[k].indexLabel||r.indexLabel||q[k].indexLabelForm
atter||

r.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:q[k],d
ataSeries:r,point:{x:0<=q[k].y?l:y,y:d},direction:0>q[k].y===a.axisY.reversed?1:-
1,bounds:{x1:Math.min(y,l),y1:u,x2:Math.max(y,l),y2:w},color:b})}}}c.restore();v&&this._
eventManager.ghostCtx.restore();a=Math.max(m,a.axisX.bounds.x2);return{source:c,dest:thi
s.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,
animationBase:a}}};A.prototype.renderStackedBar100=function(a){var c=

136
Chatbot designing

a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=null,d=this.plotArea,f=[],g=[],h=[],k=0,l,m=a.axisY.convertValueToPixel(a.axisY.logarith
mic?a.axisY.viewportMinimum:0),k=this.dataPointMinWidth?this.dataPointMinWidth:this.d
ataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:th
is.dataPointWidth?this.dataPointWidth:0.15*this.height<<0,p=a.axisX.dataInfo.minDiff;isFi
nite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:

0.9*(d.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.a
bs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>n&&(k=
Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&
(this.dataPointMinWidth&&n<k)&&(n=Math.max(this.dataPointWidth?this.dataPointWidth:
-
Infinity,k));p<k&&(p=k);p>n&&(p=n);c.save();v&&this._eventManager.ghostCtx.save();c.b
eginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();v&&(this._eventManager.ghostCtx.begi
nPath(),

this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.c
lip());for(n=0;n<a.dataSeriesIndexes.length;n++){var
e=a.dataSeriesIndexes[n],r=this.data[e],q=r.dataPoints;if(0<q.length){var
s=5<p&&r.bevelEnabled?!0:!1;c.strokeStyle="#4572A7
";for(k=0;k<q.length;k++)if(b=q[k].x.getTime?q[k].x.getTime():q[k].x,!(b<a.axisX.dataInfo.
viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof q[k].y){var
d=a.axisX.convertValueToPixel(b),u;u=0!==a.dataPointYSums[b]?100*(q[k].y/

a.dataPointYSums[b]):0;var w=d-
a.plotType.plotUnits.length*p/2+a.index*p<<0,y=w+p<<0;if(a.axisY.logarithmic){h[b]=u+(
h[b]?h[b]:0);if(0>=h[b])continue;u=f[b]?f[b]:m;f[b]=l=a.axisY.convertValueToPixel(h[b])}el
se if(l=a.axisY.convertValueToPixel(u),0<=q[k].y){var t=f[b]?f[b]:0;u=m+t;l+=t;f[b]=t+(l-
u)}else t=g[b]?g[b]:0,u=l-t,l=m-t,g[b]=t+(l-
u);b=q[k].color?q[k].color:r._colorSet[k%r._colorSet.length];N(c,u,w,l,y,b,0,null,s,!1,!1,!1,r.f
illOpacity);b=r.dataPointIds[k];this._eventManager.objectMap[b]={id:b,

objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:k,x1:u,y1:w,x2:l,y2:y};b=G(b);v&
&N(this._eventManager.ghostCtx,u,w,l,y,b,0,null,!1,!1,!1,!1);(q[k].indexLabel||r.indexLabel||
q[k].indexLabelFormatter||r.indexLabelFormatter)&&this._indexLabels.push({chartType:"sta
ckedBar100",dataPoint:q[k],dataSeries:r,point:{x:0<=q[k].y?l:u,y:d},direction:0>q[k].y===a.

137
Chatbot designing

axisY.reversed?1:-
1,bounds:{x1:Math.min(u,l),y1:w,x2:Math.max(u,l),y2:y},color:b})}}}c.restore();v&&this._
eventManager.ghostCtx.restore();a=Math.max(m,

a.axisX.bounds.x2);return{source:c,dest:this.plotArea.ctx,animationCallback:F.xScaleAnimat
ion,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderArea=func
tion(a){function
c(){t&&(0<n.lineThickness&&b.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum
&&0<=a.axisY.viewportMaximum?y=w:0>a.axisY.viewportMaximum?y=g.y1:0<a.axisY.vi
ewportMinimum&&(y=f.y2),b.lineTo(q,y),b.lineTo(t.x,y),b.closePath(),b.globalAlpha=n.fill
Opacity,b.fill(),b.globalAlpha=1,v&&(d.lineTo(q,y),d.lineTo(t.x,

y),d.closePath(),d.fill()),b.beginPath(),b.moveTo(q,s),d.beginPath(),d.moveTo(q,s),t={x:q,y:s
})}var b=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
d=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,g=a.axisY.lineCoordinates,h=[],k
=null,l=this.plotArea;b.save();v&&d.save();b.beginPath();b.rect(l.x1,l.y1,l.width,l.height);b.c
lip();v&&(d.beginPath(),d.rect(l.x1,l.y1,l.width,l.height),d.clip());for(l=0;l<a.dataSeriesIndex
es.length;l++){var m=a.dataSeriesIndexes[l],

n=this.data[m],p=n.dataPoints,h=n.id;this._eventManager.objectMap[h]={objectType:"dataS
eries",dataSeriesIndex:m};h=G(h);d.fillStyle=h;var
h=[],e=!0,r=0,q,s,u,w=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportM
inimum:0),y,t=null;if(0<p.length){var
D=n._colorSet[r%n._colorSet.length],x=n.lineColor=n.options.lineColor||D,z=x;b.fillStyle=D
;b.strokeStyle=x;b.lineWidth=n.lineThickness;var A="solid";if(b.setLineDash){var
B=I(n.nullDataLineDashType,n.lineThickness),A=n.lineDashType,R=I(A,

n.lineThickness);b.setLineDash(R)}for(var
J=!0;r<p.length;r++)if(u=p[r].x.getTime?p[r].x.getTime():p[r].x,!(u<a.axisX.dataInfo.viewPo
rtMin||u>a.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!J)))if("number"!==typeof
p[r].y)n.connectNullData||(J||e)||c(),J=!0;else{q=a.axisX.convertValueToPixel(u);s=a.axisY.c
onvertValueToPixel(p[r].y);e||J?(!e&&n.connectNullData?(b.setLineDash&&(n.options.null
DataLineDashType||A===n.lineDashType&&n.lineDashType!==n.nullDataLineDashType)
&&(b.stroke(),A=n.nullDataLineDashType,

138
Chatbot designing

b.setLineDash(B)),b.lineTo(q,s),v&&d.lineTo(q,s)):(b.beginPath(),b.moveTo(q,s),v&&(d.be
ginPath(),d.moveTo(q,s)),t={x:q,y:s}),J=e=!1):(b.lineTo(q,s),v&&d.lineTo(q,s),0==r%250&
&c());r<p.length-
1&&(z!==(p[r].lineColor||x)||A!==(p[r].lineDashType||n.lineDashType))&&(c(),z=p[r].lineC
olor||x,b.strokeStyle=z,b.setLineDash&&(p[r].lineDashType?(A=p[r].lineDashType,b.setLin
eDash(I(A,n.lineThickness))):(A=n.lineDashType,b.setLineDash(R))));var
H=n.dataPointIds[r];this._eventManager.objectMap[H]={id:H,objectType:"dataPoint",

dataSeriesIndex:m,dataPointIndex:r,x1:q,y1:s};0!==p[r].markerSize&&(0<p[r].markerSize||0
<n.markerSize)&&(u=n.getMarkerProperties(r,q,s,b),k=u.color,h.push(u),H=G(H),v&&h.pus
h({x:q,y:s,ctx:d,type:u.type,size:u.size,color:H,borderColor:H,borderThickness:u.borderThic
kness}));(p[r].indexLabel||n.indexLabel||p[r].indexLabelFormatter||n.indexLabelFormatter)&
&this._indexLabels.push({chartType:"area",dataPoint:p[r],dataSeries:n,point:{x:q,y:s},directi
on:0>p[r].y===a.axisY.reversed?1:-1,color:D})}c();P.drawMarkers(h);

n.markerColor=k}}b.restore();v&&this._eventManager.ghostCtx.restore();return{source:b,de
st:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,ani
mationBase:0}}};A.prototype.renderSplineArea=function(a){function c(){var
c=va(y,2);if(0<c.length){if(0<n.lineThickness){b.beginPath();b.moveTo(c[0].x,c[0].y);c[0].n
ewStrokeStyle&&(b.strokeStyle=c[0].newStrokeStyle);c[0].newLineDashArray&&b.setLine
Dash(c[0].newLineDashArray);for(var e=0;e<c.length-3;e+=3)if(b.bezierCurveTo(c[e+

1].x,c[e+1].y,c[e+2].x,c[e+2].y,c[e+3].x,c[e+3].y),v&&d.bezierCurveTo(c[e+1].x,c[e+1].y,c[
e+2].x,c[e+2].y,c[e+3].x,c[e+3].y),c[e+3].newStrokeStyle||c[e+3].newLineDashArray)b.strok
e(),b.beginPath(),b.moveTo(c[e+3].x,c[e+3].y),c[e+3].newStrokeStyle&&(b.strokeStyle=c[e
+3].newStrokeStyle),c[e+3].newLineDashArray&&b.setLineDash(c[e+3].newLineDashArra
y);b.stroke()}b.beginPath();b.moveTo(c[0].x,c[0].y);v&&(d.beginPath(),d.moveTo(c[0].x,c[0
].y));for(e=0;e<c.length-3;e+=3)b.bezierCurveTo(c[e+1].x,c[e+1].y,

c[e+2].x,c[e+2].y,c[e+3].x,c[e+3].y),v&&d.bezierCurveTo(c[e+1].x,c[e+1].y,c[e+2].x,c[e+2]
.y,c[e+3].x,c[e+3].y);a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.vie
wportMaximum?u=s:0>a.axisY.viewportMaximum?u=g.y1:0<a.axisY.viewportMinimum&
&(u=f.y2);w={x:c[0].x,y:c[0].y};b.lineTo(c[c.length-
1].x,u);b.lineTo(w.x,u);b.closePath();b.globalAlpha=n.fillOpacity;b.fill();b.globalAlpha=1;v
&&(d.lineTo(c[c.length-1].x,u),d.lineTo(w.x,u),d.closePath(),d.fill())}}var
b=a.targetCanvasCtx||this.plotArea.ctx;

139
Chatbot designing

if(!(0>=a.dataSeriesIndexes.length)){var
d=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,g=a.axisY.lineCoordinates,h=[],k
=null,l=this.plotArea;b.save();v&&d.save();b.beginPath();b.rect(l.x1,l.y1,l.width,l.height);b.c
lip();v&&(d.beginPath(),d.rect(l.x1,l.y1,l.width,l.height),d.clip());for(l=0;l<a.dataSeriesIndex
es.length;l++){var
m=a.dataSeriesIndexes[l],n=this.data[m],p=n.dataPoints,h=n.id;this._eventManager.objectMa
p[h]={objectType:"dataSeries",dataSeriesIndex:m};h=G(h);d.fillStyle=h;var h=

[],e=0,r,q,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0)
,u,w=null,y=[];if(0<p.length){var
t=n._colorSet[e%n._colorSet.length],D=n.lineColor=n.options.lineColor||t,x=D;b.fillStyle=t;
b.strokeStyle=D;b.lineWidth=n.lineThickness;var z="solid";if(b.setLineDash){var
A=I(n.nullDataLineDashType,n.lineThickness),z=n.lineDashType,B=I(z,n.lineThickness);b.s
etLineDash(B)}for(q=!1;e<p.length;e++)if(r=p[e].x.getTime?p[e].x.getTime():p[e].x,!(r<a.ax
isX.dataInfo.viewPortMin||r>a.axisX.dataInfo.viewPortMax&&

(!n.connectNullData||!q)))if("number"!==typeof
p[e].y)0<e&&!q&&(n.connectNullData?b.setLineDash&&(0<y.length&&(n.options.nullDat
aLineDashType||!p[e-1].lineDashType))&&(y[y.length-
1].newLineDashArray=A,z=n.nullDataLineDashType):(c(),y=[])),q=!0;else{r=a.axisX.conve
rtValueToPixel(r);q=a.axisY.convertValueToPixel(p[e].y);var
R=n.dataPointIds[e];this._eventManager.objectMap[R]={id:R,objectType:"dataPoint",dataSe
riesIndex:m,dataPointIndex:e,x1:r,y1:q};y[y.length]={x:r,y:q};e<p.length-
1&&(x!==(p[e].lineColor||

D)||z!==(p[e].lineDashType||n.lineDashType))&&(x=p[e].lineColor||D,y[y.length-
1].newStrokeStyle=x,b.setLineDash&&(p[e].lineDashType?(z=p[e].lineDashType,y[y.length
-1].newLineDashArray=I(z,n.lineThickness)):(z=n.lineDashType,y[y.length-
1].newLineDashArray=B)));if(0!==p[e].markerSize&&(0<p[e].markerSize||0<n.markerSize))
{var
J=n.getMarkerProperties(e,r,q,b),k=J.color;h.push(J);R=G(R);v&&h.push({x:r,y:q,ctx:d,type:
J.type,size:J.size,color:R,borderColor:R,borderThickness:J.borderThickness})}(p[e].indexLa
bel||

n.indexLabel||p[e].indexLabelFormatter||n.indexLabelFormatter)&&this._indexLabels.push({
chartType:"splineArea",dataPoint:p[e],dataSeries:n,point:{x:r,y:q},direction:0>p[e].y===a.ax

140
Chatbot designing

isY.reversed?1:-
1,color:t});q=!1}c();P.drawMarkers(h);n.markerColor=k}}b.restore();v&&this._eventManag
er.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnima
tion,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStepArea=functio
n(a){function c(){t&&(0<n.lineThickness&&

b.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaxi
mum?y=w:0>a.axisY.viewportMaximum?y=g.y1:0<a.axisY.viewportMinimum&&(y=f.y2),
b.lineTo(q,y),b.lineTo(t.x,y),b.closePath(),b.globalAlpha=n.fillOpacity,b.fill(),b.globalAlpha
=1,v&&(d.lineTo(q,y),d.lineTo(t.x,y),d.closePath(),d.fill()),b.beginPath(),b.moveTo(q,s),d.be
ginPath(),d.moveTo(q,s),t={x:q,y:s})}var
b=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
d=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,

g=a.axisY.lineCoordinates,h=[],k=null,l=this.plotArea;b.save();v&&d.save();b.beginPath();b.
rect(l.x1,l.y1,l.width,l.height);b.clip();v&&(d.beginPath(),d.rect(l.x1,l.y1,l.width,l.height),d.cl
ip());for(l=0;l<a.dataSeriesIndexes.length;l++){var
m=a.dataSeriesIndexes[l],n=this.data[m],p=n.dataPoints,h=n.id;this._eventManager.objectMa
p[h]={objectType:"dataSeries",dataSeriesIndex:m};h=G(h);d.fillStyle=h;var
h=[],e=!0,r=0,q,s,u,w=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportM
inimum:0),

y,t=null,D=!1;if(0<p.length){var
x=n._colorSet[r%n._colorSet.length],z=n.lineColor=n.options.lineColor||x,A=z;b.fillStyle=x;
b.strokeStyle=z;b.lineWidth=n.lineThickness;var B="solid";if(b.setLineDash){var
R=I(n.nullDataLineDashType,n.lineThickness),B=n.lineDashType,J=I(B,n.lineThickness);b.s
etLineDash(J)}for(;r<p.length;r++)if(u=p[r].x.getTime?p[r].x.getTime():p[r].x,!(u<a.axisX.d
ataInfo.viewPortMin||u>a.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!D))){var
H=s;"number"!==typeof p[r].y?(n.connectNullData||

(D||e)||c(),D=!0):(q=a.axisX.convertValueToPixel(u),s=a.axisY.convertValueToPixel(p[r].y),
e||D?(!e&&n.connectNullData?(b.setLineDash&&(n.options.nullDataLineDashType||B===n.
lineDashType&&n.lineDashType!==n.nullDataLineDashType)&&(b.stroke(),B=n.nullDataL
ineDashType,b.setLineDash(R)),b.lineTo(q,H),b.lineTo(q,s),v&&(d.lineTo(q,H),d.lineTo(q,s
))):(b.beginPath(),b.moveTo(q,s),v&&(d.beginPath(),d.moveTo(q,s)),t={x:q,y:s}),D=e=!1):(b
.lineTo(q,H),v&&d.lineTo(q,H),b.lineTo(q,s),v&&d.lineTo(q,s),0==r%250&&

141
Chatbot designing

c()),r<p.length-
1&&(A!==(p[r].lineColor||z)||B!==(p[r].lineDashType||n.lineDashType))&&(c(),A=p[r].line
Color||z,b.strokeStyle=A,b.setLineDash&&(p[r].lineDashType?(B=p[r].lineDashType,b.setLi
neDash(I(B,n.lineThickness))):(B=n.lineDashType,b.setLineDash(J)))),H=n.dataPointIds[r],t
his._eventManager.objectMap[H]={id:H,objectType:"dataPoint",dataSeriesIndex:m,dataPoin
tIndex:r,x1:q,y1:s},0!==p[r].markerSize&&(0<p[r].markerSize||0<n.markerSize)&&(u=n.get
MarkerProperties(r,q,s,b),k=u.color,h.push(u),H=G(H),

v&&h.push({x:q,y:s,ctx:d,type:u.type,size:u.size,color:H,borderColor:H,borderThickness:u.b
orderThickness})),(p[r].indexLabel||n.indexLabel||p[r].indexLabelFormatter||n.indexLabelFor
matter)&&this._indexLabels.push({chartType:"stepArea",dataPoint:p[r],dataSeries:n,point:{
x:q,y:s},direction:0>p[r].y===a.axisY.reversed?1:-
1,color:x}))}c();P.drawMarkers(h);n.markerColor=k}}b.restore();v&&this._eventManager.g
hostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation
,easingFunction:F.easing.linear,

animationBase:0}}};A.prototype.renderStackedArea=function(a){function
c(){if(!(1>l.length)){for(0<t.lineThickness&&b.stroke();0<l.length;){var
a=l.pop();b.lineTo(a.x,a.y);v&&u.lineTo(a.x,a.y)}b.closePath();b.globalAlpha=t.fillOpacity;b
.fill();b.globalAlpha=1;b.beginPath();v&&(u.closePath(),u.fill(),u.beginPath());l=[]}}var
b=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
d=null,f=[],g=null,h=this.plotArea,k=[],l=[],m=[],n=[],p=0,e,r,q,s=a.axisY.convertValueToPi
xel(a.axisY.logarithmic?

a.axisY.viewportMinimum:0),u=this._eventManager.ghostCtx;v&&u.beginPath();b.save();v
&&u.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();v&&(u.beginPath(),u.re
ct(h.x1,h.y1,h.width,h.height),u.clip());for(var
w=[],h=0;h<a.dataSeriesIndexes.length;h++){var
y=a.dataSeriesIndexes[h],t=this.data[y],D=t.dataPoints;t.dataPointIndexes=[];for(p=0;p<D.le
ngth;p++)y=D[p].x.getTime?D[p].x.getTime():D[p].x,t.dataPointIndexes[y]=p,w[y]||(m.push(
y),w[y]=!0);m.sort(za)}for(h=0;h<a.dataSeriesIndexes.length;h++){y=

a.dataSeriesIndexes[h];t=this.data[y];D=t.dataPoints;w=!0;l=[];p=t.id;this._eventManager.obj
ectMap[p]={objectType:"dataSeries",dataSeriesIndex:y};p=G(p);u.fillStyle=p;if(0<m.length)
{var
d=t._colorSet[0],x=t.lineColor=t.options.lineColor||d,z=x;b.fillStyle=d;b.strokeStyle=x;b.line

142
Chatbot designing

Width=t.lineThickness;var A="solid";if(b.setLineDash){var
B=I(t.nullDataLineDashType,t.lineThickness),A=t.lineDashType,R=I(A,t.lineThickness);b.se
tLineDash(R)}for(var J=!0,p=0;p<m.length;p++){q=m[p];var
H=null,H=0<=t.dataPointIndexes[q]?

D[t.dataPointIndexes[q]]:{x:q,y:null};if(!(q<a.axisX.dataInfo.viewPortMin||q>a.axisX.dataIn
fo.viewPortMax&&(!t.connectNullData||!J)))if("number"!==typeof
H.y)t.connectNullData||(J||w)||c(),J=!0;else{e=a.axisX.convertValueToPixel(q);var
da=k[q]?k[q]:0;if(a.axisY.logarithmic){n[q]=H.y+(n[q]?n[q]:0);if(0>=n[q])continue;r=a.axis
Y.convertValueToPixel(n[q])}else r=a.axisY.convertValueToPixel(H.y),r-
=da;l.push({x:e,y:s-da});k[q]=s-
r;w||J?(!w&&t.connectNullData?(b.setLineDash&&(t.options.nullDataLineDashType||

A===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(b.stroke(),A=t.null
DataLineDashType,b.setLineDash(B)),b.lineTo(e,r),v&&u.lineTo(e,r)):(b.beginPath(),b.mov
eTo(e,r),v&&(u.beginPath(),u.moveTo(e,r))),J=w=!1):(b.lineTo(e,r),v&&u.lineTo(e,r),0==p
%250&&(c(),b.moveTo(e,r),v&&u.moveTo(e,r),l.push({x:e,y:s-da})));p<D.length-
1&&(z!==(D[p].lineColor||x)||A!==(D[p].lineDashType||t.lineDashType))&&(c(),b.beginPat
h(),b.moveTo(e,r),l.push({x:e,y:s-da}),z=D[p].lineColor||x,b.strokeStyle=z,b.setLineDash&&

(D[p].lineDashType?(A=D[p].lineDashType,b.setLineDash(I(A,t.lineThickness))):(A=t.lineD
ashType,b.setLineDash(R))));if(0<=t.dataPointIndexes[q]){var
ea=t.dataPointIds[t.dataPointIndexes[q]];this._eventManager.objectMap[ea]={id:ea,objectTy
pe:"dataPoint",dataSeriesIndex:y,dataPointIndex:t.dataPointIndexes[q],x1:e,y1:r}}0<=t.dataP
ointIndexes[q]&&0!==H.markerSize&&(0<H.markerSize||0<t.markerSize)&&(q=t.getMarke
rProperties(t.dataPointIndexes[q],e,r,b),g=q.color,f.push(q),markerColor=G(ea),v&&f.push({
x:e,

y:r,ctx:u,type:q.type,size:q.size,color:markerColor,borderColor:markerColor,borderThickness
:q.borderThickness}));(H.indexLabel||t.indexLabel||H.indexLabelFormatter||t.indexLabelFor
matter)&&this._indexLabels.push({chartType:"stackedArea",dataPoint:H,dataSeries:t,point:{
x:e,y:r},direction:0>D[p].y===a.axisY.reversed?1:-
1,color:d})}}c();b.moveTo(e,r);v&&u.moveTo(e,r)}delete
t.dataPointIndexes;t.markerColor=g}P.drawMarkers(f);b.restore();v&&u.restore();return{sou
rce:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,

143
Chatbot designing

easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStackedArea100=func
tion(a){function c(){for(0<t.lineThickness&&b.stroke();0<l.length;){var
a=l.pop();b.lineTo(a.x,a.y);v&&u.lineTo(a.x,a.y)}b.closePath();b.globalAlpha=t.fillOpacity;b
.fill();b.globalAlpha=1;b.beginPath();v&&(u.closePath(),u.fill(),u.beginPath());l=[]}var
b=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
d=null,f=this.plotArea,g=[],h=null,k=[],l=[],m=[],n=[],p=0,e,r,q,s=a.axisY.convertValueToPi
xel(a.axisY.logarithmic?

a.axisY.viewportMinimum:0),u=this._eventManager.ghostCtx;b.save();v&&u.save();b.begin
Path();b.rect(f.x1,f.y1,f.width,f.height);b.clip();v&&(u.beginPath(),u.rect(f.x1,f.y1,f.width,f.h
eight),u.clip());for(var w=[],f=0;f<a.dataSeriesIndexes.length;f++){var
y=a.dataSeriesIndexes[f],t=this.data[y],x=t.dataPoints;t.dataPointIndexes=[];for(p=0;p<x.len
gth;p++)y=x[p].x.getTime?x[p].x.getTime():x[p].x,t.dataPointIndexes[y]=p,w[y]||(m.push(y),
w[y]=!0);m.sort(za)}for(f=0;f<a.dataSeriesIndexes.length;f++){y=a.dataSeriesIndexes[f];

t=this.data[y];x=t.dataPoints;w=!0;d=t.id;this._eventManager.objectMap[d]={objectType:"da
taSeries",dataSeriesIndex:y};d=G(d);u.fillStyle=d;l=[];if(0<m.length){var
d=t._colorSet[p%t._colorSet.length],z=t.lineColor=t.options.lineColor||d,A=z;b.fillStyle=d;b.
strokeStyle=z;b.lineWidth=t.lineThickness;var B="solid";if(b.setLineDash){var
E=I(t.nullDataLineDashType,t.lineThickness),B=t.lineDashType,R=I(B,t.lineThickness);b.se
tLineDash(R)}for(var J=!0,p=0;p<m.length;p++){q=m[p];var
H=null,H=0<=t.dataPointIndexes[q]?

x[t.dataPointIndexes[q]]:{x:q,y:null};if(!(q<a.axisX.dataInfo.viewPortMin||q>a.axisX.dataInf
o.viewPortMax&&(!t.connectNullData||!J)))if("number"!==typeof
H.y)t.connectNullData||(J||w)||c(),J=!0;else{var
da;da=0!==a.dataPointYSums[q]?100*(H.y/a.dataPointYSums[q]):0;e=a.axisX.convertValue
ToPixel(q);var
ea=k[q]?k[q]:0;if(a.axisY.logarithmic){n[q]=da+(n[q]?n[q]:0);if(0>=n[q])continue;r=a.axisY
.convertValueToPixel(n[q])}else r=a.axisY.convertValueToPixel(da),r-=ea;l.push({x:e,y:s-
ea});k[q]=s-r;w||J?(!w&&

t.connectNullData?(b.setLineDash&&(t.options.nullDataLineDashType||B===t.lineDashTyp
e&&t.lineDashType!==t.nullDataLineDashType)&&(b.stroke(),B=t.nullDataLineDashType,
b.setLineDash(E)),b.lineTo(e,r),v&&u.lineTo(e,r)):(b.beginPath(),b.moveTo(e,r),v&&(u.begi
nPath(),u.moveTo(e,r))),J=w=!1):(b.lineTo(e,r),v&&u.lineTo(e,r),0==p%250&&(c(),b.move

144
Chatbot designing

To(e,r),v&&u.moveTo(e,r),l.push({x:e,y:s-ea})));p<x.length-
1&&(A!==(x[p].lineColor||z)||B!==(x[p].lineDashType||t.lineDashType))&&(c(),b.beginPath
(),b.moveTo(e,r),

l.push({x:e,y:s-
ea}),A=x[p].lineColor||z,b.strokeStyle=A,b.setLineDash&&(x[p].lineDashType?(B=x[p].line
DashType,b.setLineDash(I(B,t.lineThickness))):(B=t.lineDashType,b.setLineDash(R))));if(0
<=t.dataPointIndexes[q]){var
Ga=t.dataPointIds[t.dataPointIndexes[q]];this._eventManager.objectMap[Ga]={id:Ga,object
Type:"dataPoint",dataSeriesIndex:y,dataPointIndex:t.dataPointIndexes[q],x1:e,y1:r}}0<=t.da
taPointIndexes[q]&&0!==H.markerSize&&(0<H.markerSize||0<t.markerSize)&&(q=t.getMa
rkerProperties(p,e,r,b),

h=q.color,g.push(q),markerColor=G(Ga),v&&g.push({x:e,y:r,ctx:u,type:q.type,size:q.size,col
or:markerColor,borderColor:markerColor,borderThickness:q.borderThickness}));(H.indexLa
bel||t.indexLabel||H.indexLabelFormatter||t.indexLabelFormatter)&&this._indexLabels.push(
{chartType:"stackedArea100",dataPoint:H,dataSeries:t,point:{x:e,y:r},direction:0>x[p].y===
a.axisY.reversed?1:-1,color:d})}}c();b.moveTo(e,r);v&&u.moveTo(e,r)}delete
t.dataPointIndexes;t.markerColor=h}P.drawMarkers(g);b.restore();v&&u.restore();

return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:
F.easing.linear,animationBase:0}}};A.prototype.renderBubble=function(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=this.plotArea,d=0,f,g;c.save();v&&this._eventManager.ghostCtx.save();c.beginPath();c.rec
t(b.x1,b.y1,b.width,b.height);c.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._ev
entManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());

for(var h=-Infinity,k=Infinity,l=0;l<a.dataSeriesIndexes.length;l++)for(var
m=a.dataSeriesIndexes[l],n=this.data[m],p=n.dataPoints,e=0,d=0;d<p.length;d++)f=p[d].getT
ime?f=p[d].x.getTime():f=p[d].x,f<a.axisX.dataInfo.viewPortMin||f>a.axisX.dataInfo.viewPo
rtMax||"undefined"===typeof p[d].z||(e=p[d].z,e>h&&(h=e),e<k&&(k=e));for(var
r=25*Math.PI,b=Math.max(Math.pow(0.25*Math.min(b.height,b.width)/2,2)*Math.PI,r),l=0;
l<a.dataSeriesIndexes.length;l++)if(m=a.dataSeriesIndexes[l],n=this.data[m],p=n.dataPoints,

0<p.length)for(c.strokeStyle="#4572A7
",d=0;d<p.length;d++)if(f=p[d].getTime?f=p[d].x.getTime():f=p[d].x,!(f<a.axisX.dataInfo.vi

145
Chatbot designing

ewPortMin||f>a.axisX.dataInfo.viewPortMax)&&"number"===typeof
p[d].y){f=a.axisX.convertValueToPixel(f);g=a.axisY.convertValueToPixel(p[d].y);var
e=p[d].z,q=2*Math.max(Math.sqrt((h===k?b/2:r+(b-r)/(h-k)*(e-
k))/Math.PI)<<0,1),e=n.getMarkerProperties(d,c);e.size=q;c.globalAlpha=n.fillOpacity;P.dra
wMarker(f,g,c,e.type,e.size,e.color,e.borderColor,e.borderThickness);c.globalAlpha=

1;var
s=n.dataPointIds[d];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeri
esIndex:m,dataPointIndex:d,x1:f,y1:g,size:q};q=G(s);v&&P.drawMarker(f,g,this._eventMan
ager.ghostCtx,e.type,e.size,q,q,e.borderThickness);(p[d].indexLabel||n.indexLabel||p[d].index
LabelFormatter||n.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",data
Point:p[d],dataSeries:n,point:{x:f,y:g},direction:1,bounds:{x1:f-e.size/2,y1:g-
e.size/2,x2:f+e.size/2,y2:g+e.size/2},color:null})}c.restore();

v&&this._eventManager.ghostCtx.restore();return{source:c,dest:this.plotArea.ctx,animation
Callback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.pro
totype.renderScatter=function(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=this.plotArea,d=0,f,g;c.save();v&&this._eventManager.ghostCtx.save();c.beginPath();c.rec
t(b.x1,b.y1,b.width,b.height);c.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._ev
entManager.ghostCtx.rect(b.x1,

b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var
h=0;h<a.dataSeriesIndexes.length;h++){var
k=a.dataSeriesIndexes[h],l=this.data[k],m=l.dataPoints;if(0<m.length){c.strokeStyle="#4572
A7 ";Math.pow(0.3*Math.min(b.height,b.width)/2,2);for(var
n=0,p=0,d=0;d<m.length;d++)if(f=m[d].getTime?f=m[d].x.getTime():f=m[d].x,!(f<a.axisX.d
ataInfo.viewPortMin||f>a.axisX.dataInfo.viewPortMax)&&"number"===typeof
m[d].y){f=a.axisX.convertValueToPixel(f);g=a.axisY.convertValueToPixel(m[d].y);var
e=l.getMarkerProperties(d,

f,g,c);c.globalAlpha=l.fillOpacity;P.drawMarker(e.x,e.y,e.ctx,e.type,e.size,e.color,e.borderCo
lor,e.borderThickness);c.globalAlpha=1;Math.sqrt((n-f)*(n-f)+(p-g)*(p-
g))<Math.min(e.size,5)&&m.length>Math.min(this.plotArea.width,this.plotArea.height)||(n=l
.dataPointIds[d],this._eventManager.objectMap[n]={id:n,objectType:"dataPoint",dataSeriesI

146
Chatbot designing

ndex:k,dataPointIndex:d,x1:f,y1:g},n=G(n),v&&P.drawMarker(e.x,e.y,this._eventManager.g
hostCtx,e.type,e.size,n,n,e.borderThickness),(m[d].indexLabel||l.indexLabel||

m[d].indexLabelFormatter||l.indexLabelFormatter)&&this._indexLabels.push({chartType:"sc
atter",dataPoint:m[d],dataSeries:l,point:{x:f,y:g},direction:1,bounds:{x1:f-e.size/2,y1:g-
e.size/2,x2:f+e.size/2,y2:g+e.size/2},color:null}),n=f,p=g)}}}c.restore();v&&this._eventMan
ager.ghostCtx.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:F.fadeInAni
mation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderCandlest
ick=function(a){var c=a.targetCanvasCtx||this.plotArea.ctx,

b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var
d=null,d=this.plotArea,f=0,g,h,k,l,m,n,f=this.dataPointMinWidth?this.dataPointMinWidth:thi
s.dataPointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth
:this.dataPointWidth?this.dataPointWidth:0.015*this.width;var
p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWi
dth?this.dataPointWidth:0.7*d.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.ran
ge):Math.abs(p)/

Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&f>g&&(f=Math.min(this.dataPoint
Width?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth
&&g<f)&&(g=Math.max(this.dataPointWidth?this.dataPointWidth:-
Infinity,f));p<f&&(p=f);p>g&&(p=g);c.save();v&&b.save();c.beginPath();c.rect(d.x1,d.y1,d.
width,d.height);c.clip();v&&(b.beginPath(),b.rect(d.x1,d.y1,d.width,d.height),b.clip());for(var
e=0;e<a.dataSeriesIndexes.length;e++){var
r=a.dataSeriesIndexes[e],q=this.data[r],s=q.dataPoints;

if(0<s.length)for(var
u=5<p&&q.bevelEnabled?!0:!1,f=0;f<s.length;f++)if(s[f].getTime?n=s[f].x.getTime():n=s[f].
x,!(n<a.axisX.dataInfo.viewPortMin||n>a.axisX.dataInfo.viewPortMax)&&null!==s[f].y&&s
[f].y.length&&"number"===typeof s[f].y[0]&&"number"===typeof
s[f].y[1]&&"number"===typeof s[f].y[2]&&"number"===typeof
s[f].y[3]){g=a.axisX.convertValueToPixel(n);h=a.axisY.convertValueToPixel(s[f].y[0]);k=a.
axisY.convertValueToPixel(s[f].y[1]);l=a.axisY.convertValueToPixel(s[f].y[2]);m=a.axisY.c
onvertValueToPixel(s[f].y[3]);

147
Chatbot designing

var w=g-
p/2<<0,y=w+p<<0,d=s[f].color?s[f].color:q._colorSet[0],t=Math.round(Math.max(1,0.15*p))
,x=0===t%2?0:0.5,z=q.dataPointIds[f];this._eventManager.objectMap[z]={id:z,objectType:"
dataPoint",dataSeriesIndex:r,dataPointIndex:f,x1:w,y1:h,x2:y,y2:k,x3:g,y3:l,x4:g,y4:m,borde
rThickness:t,color:d};c.strokeStyle=d;c.beginPath();c.lineWidth=t;b.lineWidth=Math.max(t,4
);"candlestick"===q.type?(c.moveTo(g-x,k),c.lineTo(g-
x,Math.min(h,m)),c.stroke(),c.moveTo(g-x,Math.max(h,m)),c.lineTo(g-x,l),c.stroke(),N(c,

w,Math.min(h,m),y,Math.max(h,m),s[f].y[0]<=s[f].y[3]?q.risingColor:d,t,d,u,u,!1,!1,q.fillOp
acity),v&&(d=G(z),b.strokeStyle=d,b.moveTo(g-x,k),b.lineTo(g-
x,Math.min(h,m)),b.stroke(),b.moveTo(g-x,Math.max(h,m)),b.lineTo(g-
x,l),b.stroke(),N(b,w,Math.min(h,m),y,Math.max(h,m),d,0,null,!1,!1,!1,!1))):"ohlc"===q.type
&&(c.moveTo(g-x,k),c.lineTo(g-
x,l),c.stroke(),c.beginPath(),c.moveTo(g,h),c.lineTo(w,h),c.stroke(),c.beginPath(),c.moveTo(
g,m),c.lineTo(y,m),c.stroke(),v&&(d=G(z),b.strokeStyle=d,b.moveTo(g-x,

k),b.lineTo(g-
x,l),b.stroke(),b.beginPath(),b.moveTo(g,h),b.lineTo(w,h),b.stroke(),b.beginPath(),b.moveTo(
g,m),b.lineTo(y,m),b.stroke()));(s[f].indexLabel||q.indexLabel||s[f].indexLabelFormatter||q.in
dexLabelFormatter)&&this._indexLabels.push({chartType:q.type,dataPoint:s[f],dataSeries:q,
point:{x:w+(y-
w)/2,y:a.axisY.reversed?l:k},direction:1,bounds:{x1:w,y1:Math.min(k,l),x2:y,y2:Math.max(k
,l)},color:d})}}c.restore();v&&b.restore();return{source:c,dest:this.plotArea.ctx,animationCa
llback:F.fadeInAnimation,

easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderRangeColumn=
function(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
b=null,d=this.plotArea,f=0,g,h,f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataP
ointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.da
taPointWidth?this.dataPointWidth:0.03*this.width;var
k=a.axisX.dataInfo.minDiff;isFinite(k)||(k=0.3*Math.abs(a.axisX.range));k=this.dataPointWi
dth?

this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(k)/Math.log(a.axisX.range)
:Math.abs(k)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWi

148
Chatbot designing

dth&&f>g&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPo
intMaxWidth&&(this.dataPointMinWidth&&g<f)&&(g=Math.max(this.dataPointWidth?this
.dataPointWidth:-
Infinity,f));k<f&&(k=f);k>g&&(k=g);c.save();v&&this._eventManager.ghostCtx.save();c.be
ginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();

v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,
d.width,d.height),this._eventManager.ghostCtx.clip());for(var
l=0;l<a.dataSeriesIndexes.length;l++){var
m=a.dataSeriesIndexes[l],n=this.data[m],p=n.dataPoints;if(0<p.length)for(var
e=5<k&&n.bevelEnabled?!0:!1,f=0;f<p.length;f++)if(p[f].getTime?h=p[f].x.getTime():h=p[f
].x,!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&null!==p[f].y&
&p[f].y.length&&"number"===typeof p[f].y[0]&&"number"===typeof p[f].y[1]){b=

a.axisX.convertValueToPixel(h);d=a.axisY.convertValueToPixel(p[f].y[0]);g=a.axisY.conver
tValueToPixel(p[f].y[1]);var r=a.axisX.reversed?b+a.plotType.totalDataSeries*k/2-
(a.previousDataSeriesCount+l)*k<<0:b-
a.plotType.totalDataSeries*k/2+(a.previousDataSeriesCount+l)*k<<0,q=a.axisX.reversed?r-
k<<0:r+k<<0,b=p[f].color?p[f].color:n._colorSet[f%n._colorSet.length];if(d>g){var
s=d,d=g;g=s}s=n.dataPointIds[f];this._eventManager.objectMap[s]={id:s,objectType:"dataPo
int",dataSeriesIndex:m,dataPointIndex:f,

x1:r,y1:d,x2:q,y2:g};N(c,r,d,q,g,b,0,b,e,e,!1,!1,n.fillOpacity);b=G(s);v&&N(this._eventMana
ger.ghostCtx,r,d,q,g,b,0,null,!1,!1,!1,!1);if(p[f].indexLabel||n.indexLabel||p[f].indexLabelFor
matter||n.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:
p[f],dataSeries:n,indexKeyword:0,point:{x:r+(q-
r)/2,y:p[f].y[1]>=p[f].y[0]?g:d},direction:p[f].y[1]>=p[f].y[0]?-
1:1,bounds:{x1:r,y1:Math.min(d,g),x2:q,y2:Math.max(d,g)},color:b}),this._indexLabels.push
({chartType:"rangeColumn",

dataPoint:p[f],dataSeries:n,indexKeyword:1,point:{x:r+(q-
r)/2,y:p[f].y[1]>=p[f].y[0]?d:g},direction:p[f].y[1]>=p[f].y[0]?1:-
1,bounds:{x1:r,y1:Math.min(d,g),x2:q,y2:Math.max(d,g)},color:b})}}c.restore();v&&this._e
ventManager.ghostCtx.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:F.f
adeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.rende

149
Chatbot designing

rRangeBar=function(a){var
c=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,

d=this.plotArea,f=0,g,h,k,f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPoint
Width?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataP
ointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotTy
pe.totalDataSeries))<<0;var
l=a.axisX.dataInfo.minDiff;isFinite(l)||(l=0.3*Math.abs(a.axisX.range));l=this.dataPointWidt
h?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(l)/Math.log(a.axisX.rang
e):Math.abs(l)/Math.abs(a.axisX.range))/

a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>g&&(f=Math.min(this.dataPoi
ntWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWid
th&&g<f)&&(g=Math.max(this.dataPointWidth?this.dataPointWidth:-
Infinity,f));l<f&&(l=f);l>g&&(l=g);c.save();v&&this._eventManager.ghostCtx.save();c.begi
nPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();v&&(this._eventManager.ghostCtx.beginP
ath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghost
Ctx.clip());

for(var m=0;m<a.dataSeriesIndexes.length;m++){var
n=a.dataSeriesIndexes[m],p=this.data[n],e=p.dataPoints;if(0<e.length){var
r=5<l&&p.bevelEnabled?!0:!1;c.strokeStyle="#4572A7
";for(f=0;f<e.length;f++)if(e[f].getTime?k=e[f].x.getTime():k=e[f].x,!(k<a.axisX.dataInfo.vie
wPortMin||k>a.axisX.dataInfo.viewPortMax)&&null!==e[f].y&&e[f].y.length&&"number"=
==typeof e[f].y[0]&&"number"===typeof
e[f].y[1]){d=a.axisY.convertValueToPixel(e[f].y[0]);g=a.axisY.convertValueToPixel(e[f].y[
1]);h=a.axisX.convertValueToPixel(k);

h=a.axisX.reversed?h+a.plotType.totalDataSeries*l/2-
(a.previousDataSeriesCount+m)*l<<0:h-
a.plotType.totalDataSeries*l/2+(a.previousDataSeriesCount+m)*l<<0;var
q=a.axisX.reversed?h-
l<<0:h+l<<0;d>g&&(b=d,d=g,g=b);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length
];N(c,d,h,g,q,b,0,null,r,!1,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.object
Map[b]={id:b,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:d,y1:h,x2:g,y2:
q};b=G(b);v&&N(this._eventManager.ghostCtx,d,h,g,q,

150
Chatbot designing

b,0,null,!1,!1,!1,!1);if(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelF
ormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:e[f],dataSeries:p,indexKey
word:0,point:{x:e[f].y[1]>=e[f].y[0]?d:g,y:h+(q-h)/2},direction:e[f].y[1]>=e[f].y[0]?-
1:1,bounds:{x1:Math.min(d,g),y1:h,x2:Math.max(d,g),y2:q},color:b}),this._indexLabels.pus
h({chartType:"rangeBar",dataPoint:e[f],dataSeries:p,indexKeyword:1,point:{x:e[f].y[1]>=e[f
].y[0]?g:d,y:h+(q-h)/2},direction:e[f].y[1]>=e[f].y[0]?

1:-
1,bounds:{x1:Math.min(d,g),y1:h,x2:Math.max(d,g),y2:q},color:b})}}}c.restore();v&&this._
eventManager.ghostCtx.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:F.
fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.rend
erRangeArea=function(a){function c(){if(w){var
a=null;0<m.lineThickness&&b.stroke();for(var c=k.length-1;0<=c;c--
)a=k[c],b.lineTo(a.x,a.y),d.lineTo(a.x,a.y);b.closePath();b.globalAlpha=m.fillOpacity;b.fill();
b.globalAlpha=1;d.fill();

if(0<m.lineThickness){b.beginPath();b.moveTo(a.x,a.y);for(c=0;c<k.length;c++)a=k[c],b.line
To(a.x,a.y);b.stroke()}b.beginPath();b.moveTo(r,q);d.beginPath();d.moveTo(r,q);w={x:r,y:q}
;k=[];k.push({x:r,y:s})}}var
b=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
d=this._eventManager.ghostCtx,f=[],g=null,h=this.plotArea;b.save();v&&d.save();b.beginPat
h();b.rect(h.x1,h.y1,h.width,h.height);b.clip();v&&(d.beginPath(),d.rect(h.x1,h.y1,h.width,h.h
eight),d.clip());for(h=0;h<a.dataSeriesIndexes.length;h++){var k=

[],l=a.dataSeriesIndexes[h],m=this.data[l],n=m.dataPoints,f=m.id;this._eventManager.object
Map[f]={objectType:"dataSeries",dataSeriesIndex:l};f=G(f);d.fillStyle=f;var
f=[],p=!0,e=0,r,q,s,u,w=null;if(0<n.length){var
y=m._colorSet[e%m._colorSet.length],t=m.lineColor=m.options.lineColor||y,x=t;b.fillStyle=
y;b.strokeStyle=t;b.lineWidth=m.lineThickness;var z="solid";if(b.setLineDash){var
A=I(m.nullDataLineDashType,m.lineThickness),z=m.lineDashType,B=I(z,m.lineThickness);
b.setLineDash(B)}for(var E=!0;e<

n.length;e++)if(u=n[e].x.getTime?n[e].x.getTime():n[e].x,!(u<a.axisX.dataInfo.viewPortMin||
u>a.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!E)))if(null!==n[e].y&&n[e].y.len
gth&&"number"===typeof n[e].y[0]&&"number"===typeof
n[e].y[1]){r=a.axisX.convertValueToPixel(u);q=a.axisY.convertValueToPixel(n[e].y[0]);s=a.

151
Chatbot designing

axisY.convertValueToPixel(n[e].y[1]);p||E?(m.connectNullData&&!p?(b.setLineDash&&(m.
options.nullDataLineDashType||z===m.lineDashType&&m.lineDashType!==m.nullDataLin
eDashType)&&(k[k.length-

1].newLineDashArray=B,z=m.nullDataLineDashType,b.setLineDash(A)),b.lineTo(r,q),v&&
d.lineTo(r,q),k.push({x:r,y:s})):(b.beginPath(),b.moveTo(r,q),w={x:r,y:q},k=[],k.push({x:r,y:
s}),v&&(d.beginPath(),d.moveTo(r,q))),E=p=!1):(b.lineTo(r,q),k.push({x:r,y:s}),v&&d.lineT
o(r,q),0==e%250&&c());u=m.dataPointIds[e];this._eventManager.objectMap[u]={id:u,object
Type:"dataPoint",dataSeriesIndex:l,dataPointIndex:e,x1:r,y1:q,y2:s};e<n.length-
1&&(x!==(n[e].lineColor||t)||z!==(n[e].lineDashType||m.lineDashType))&&(c(),

x=n[e].lineColor||t,k[k.length-
1].newStrokeStyle=x,b.strokeStyle=x,b.setLineDash&&(n[e].lineDashType?(z=n[e].lineDash
Type,k[k.length-1].newLineDashArray=I(z,m.lineThickness),b.setLineDash(k[k.length-
1].newLineDashArray)):(z=m.lineDashType,k[k.length-
1].newLineDashArray=B,b.setLineDash(B))));if(0!==n[e].markerSize&&(0<n[e].markerSize
||0<m.markerSize)){var R=m.getMarkerProperties(e,r,s,b);f.push(R);var
J=G(u);v&&f.push({x:r,y:s,ctx:d,type:R.type,size:R.size,color:J,borderColor:J,borderThickne
ss:R.borderThickness});

R=m.getMarkerProperties(e,r,q,b);g=R.color;f.push(R);J=G(u);v&&f.push({x:r,y:q,ctx:d,typ
e:R.type,size:R.size,color:J,borderColor:J,borderThickness:R.borderThickness})}if(n[e].inde
xLabel||m.indexLabel||n[e].indexLabelFormatter||m.indexLabelFormatter)this._indexLabels.p
ush({chartType:"rangeArea",dataPoint:n[e],dataSeries:m,indexKeyword:0,point:{x:r,y:q},dir
ection:n[e].y[0]>n[e].y[1]===a.axisY.reversed?-
1:1,color:y}),this._indexLabels.push({chartType:"rangeArea",dataPoint:n[e],dataSeries:m,in
dexKeyword:1,

point:{x:r,y:s},direction:n[e].y[0]>n[e].y[1]===a.axisY.reversed?1:-1,color:y})}else
E||p||c(),E=!0;c();P.drawMarkers(f);m.markerColor=g}}b.restore();v&&this._eventManager.
ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimatio
n,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderRangeSplineArea=f
unction(a){function c(a,c){var
e=va(q,2);if(0<e.length){if(0<l.lineThickness){b.strokeStyle=c;b.setLineDash&&b.setLineD
ash(a);b.beginPath();b.moveTo(e[0].x,

152
Chatbot designing

e[0].y);for(var f=0;f<e.length-
3;f+=3){if(e[f].newStrokeStyle||e[f].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(e
[f].x,e[f].y),e[f].newStrokeStyle&&(b.strokeStyle=e[f].newStrokeStyle),e[f].newLineDashAr
ray&&b.setLineDash(e[f].newLineDashArray);b.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[
f+2].y,e[f+3].x,e[f+3].y)}b.stroke()}b.beginPath();b.moveTo(e[0].x,e[0].y);v&&(d.beginPath
(),d.moveTo(e[0].x,e[0].y));for(f=0;f<e.length-
3;f+=3)b.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,

e[f+3].y),v&&d.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,e[f+3].y);e=va(s,
2);b.lineTo(s[s.length-1].x,s[s.length-1].y);for(f=e.length-1;2<f;f-=3)b.bezierCurveTo(e[f-
1].x,e[f-1].y,e[f-2].x,e[f-2].y,e[f-3].x,e[f-3].y),v&&d.bezierCurveTo(e[f-1].x,e[f-1].y,e[f-
2].x,e[f-2].y,e[f-3].x,e[f-
3].y);b.closePath();b.globalAlpha=l.fillOpacity;b.fill();v&&(d.closePath(),d.fill());b.globalAl
pha=1;if(0<l.lineThickness){b.strokeStyle=c;b.setLineDash&&b.setLineDash(a);b.beginPath
();b.moveTo(e[0].x,

e[0].y);for(var g=f=0;f<e.length-
3;f+=3,g++){if(q[g].newStrokeStyle||q[g].newLineDashArray)b.stroke(),b.beginPath(),b.mov
eTo(e[f].x,e[f].y),q[g].newStrokeStyle&&(b.strokeStyle=q[g].newStrokeStyle),q[g].newLine
DashArray&&b.setLineDash(q[g].newLineDashArray);b.bezierCurveTo(e[f+1].x,e[f+1].y,e[
f+2].x,e[f+2].y,e[f+3].x,e[f+3].y)}b.stroke()}b.beginPath()}}var
b=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var
d=this._eventManager.ghostCtx,f=[],g=null,h=this.plotArea;b.save();

v&&d.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();v&&(d.beginPath(),d.r
ect(h.x1,h.y1,h.width,h.height),d.clip());for(h=0;h<a.dataSeriesIndexes.length;h++){var
k=a.dataSeriesIndexes[h],l=this.data[k],m=l.dataPoints,f=l.id;this._eventManager.objectMap[
f]={objectType:"dataSeries",dataSeriesIndex:k};f=G(f);d.fillStyle=f;var
f=[],n=0,p,e,r,q=[],s=[];if(0<m.length){var
u=l._colorSet[n%l._colorSet.length],w=l.lineColor=l.options.lineColor||u,y=w;b.fillStyle=u;b
.lineWidth=l.lineThickness;

var t="solid",x;if(b.setLineDash){var
z=I(l.nullDataLineDashType,l.lineThickness),t=l.lineDashType;x=I(t,l.lineThickness)}for(e=
!1;n<m.length;n++)if(p=m[n].x.getTime?m[n].x.getTime():m[n].x,!(p<a.axisX.dataInfo.view
PortMin||p>a.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!e)))if(null!==m[n].y&&

153
Chatbot designing

m[n].y.length&&"number"===typeof m[n].y[0]&&"number"===typeof
m[n].y[1]){p=a.axisX.convertValueToPixel(p);e=a.axisY.convertValueToPixel(m[n].y[0]);r=
a.axisY.convertValueToPixel(m[n].y[1]);var A=l.dataPointIds[n];

this._eventManager.objectMap[A]={id:A,objectType:"dataPoint",dataSeriesIndex:k,dataPoin
tIndex:n,x1:p,y1:e,y2:r};q[q.length]={x:p,y:e};s[s.length]={x:p,y:r};n<m.length-
1&&(y!==(m[n].lineColor||w)||t!==(m[n].lineDashType||l.lineDashType))&&(y=m[n].lineCo
lor||w,q[q.length-
1].newStrokeStyle=y,b.setLineDash&&(m[n].lineDashType?(t=m[n].lineDashType,q[q.lengt
h-1].newLineDashArray=I(t,l.lineThickness)):(t=l.lineDashType,q[q.length-
1].newLineDashArray=x)));if(0!==m[n].markerSize&&(0<m[n].markerSize||0<l.markerSize)
){var B=

l.getMarkerProperties(n,p,e,b),g=B.color;f.push(B);var
E=G(A);v&&f.push({x:p,y:e,ctx:d,type:B.type,size:B.size,color:E,borderColor:E,borderThic
kness:B.borderThickness});B=l.getMarkerProperties(n,p,r,b);f.push(B);E=G(A);v&&f.push(
{x:p,y:r,ctx:d,type:B.type,size:B.size,color:E,borderColor:E,borderThickness:B.borderThickn
ess})}if(m[n].indexLabel||l.indexLabel||m[n].indexLabelFormatter||l.indexLabelFormatter)thi
s._indexLabels.push({chartType:"splineArea",dataPoint:m[n],dataSeries:l,indexKeyword:0,p
oint:{x:p,

y:e},direction:m[n].y[0]<=m[n].y[1]?-
1:1,color:u}),this._indexLabels.push({chartType:"splineArea",dataPoint:m[n],dataSeries:l,in
dexKeyword:1,point:{x:p,y:r},direction:m[n].y[0]<=m[n].y[1]?1:-1,color:u});e=!1}else
0<n&&!e&&(l.connectNullData?b.setLineDash&&(0<q.length&&(l.options.nullDataLineDa
shType||!m[n-1].lineDashType))&&(q[q.length-
1].newLineDashArray=z,t=l.nullDataLineDashType):(c(x,w),q=[],s=[])),e=!0;c(x,w);P.draw
Markers(f);l.markerColor=g}}b.restore();v&&this._eventManager.ghostCtx.restore();

return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:
F.easing.linear,animationBase:0}}};var
Ha=function(a,c,b,d,f,g,h,k,l){if(!(0>b)){"undefined"===typeof k&&(k=1);if(!v){var
m=Number((h%(2*Math.PI)).toFixed(8));Number((g%(2*Math.PI)).toFixed(8))===m&&(h-
=1E-
4)}a.save();a.globalAlpha=k;"pie"===f?(a.beginPath(),a.moveTo(c.x,c.y),a.arc(c.x,c.y,b,g,h,!

154
Chatbot designing

1),a.fillStyle=d,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===f&
&(a.beginPath(),a.arc(c.x,

c.y,b,g,h,!1),0<=l&&a.arc(c.x,c.y,l*b,h,g,!0),a.closePath(),a.fillStyle=d,a.strokeStyle="white
",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};A.prototype.renderPie=function(a){fu
nction c(){if(m&&n){for(var a=0,b=0,c=0,d=0,f=0;f<n.length;f++){var
g=n[f],h=m.dataPointIds[f],k={id:h,objectType:"dataPoint",dataPointIndex:f,dataSeriesIndex
:0};r.push(k);var
p={percent:null,total:null},q=null,p=l.getPercentAndTotal(m,g);if(m.indexLabelFormatter||g.
indexLabelFormatter)q={chart:l.options,dataSeries:m,

dataPoint:g,total:p.total,percent:p.percent};p=g.indexLabelFormatter?g.indexLabelFormatter(
q):g.indexLabel?l.replaceKeywordsWithValue(g.indexLabel,g,m,f):m.indexLabelFormatter?
m.indexLabelFormatter(q):m.indexLabel?l.replaceKeywordsWithValue(m.indexLabel,g,m,f)
:g.label?g.label:"";l._eventManager.objectMap[h]=k;k.center={x:t.x,y:t.y};k.y=g.y;k.radius=
B;k.percentInnerRadius=F;k.indexLabelText=p;k.indexLabelPlacement=m.indexLabelPlace
ment;k.indexLabelLineColor=g.indexLabelLineColor?g.indexLabelLineColor:

m.options.indexLabelLineColor?m.options.indexLabelLineColor:g.color?g.color:m._colorSet
[f%m._colorSet.length];k.indexLabelLineThickness=x(g.indexLabelLineThickness)?m.index
LabelLineThickness:g.indexLabelLineThickness;k.indexLabelLineDashType=g.indexLabelL
ineDashType?g.indexLabelLineDashType:m.indexLabelLineDashType;k.indexLabelFontCol
or=g.indexLabelFontColor?g.indexLabelFontColor:m.indexLabelFontColor;k.indexLabelFon
tStyle=g.indexLabelFontStyle?g.indexLabelFontStyle:m.indexLabelFontStyle;k.indexLabelF
ontWeight=

g.indexLabelFontWeight?g.indexLabelFontWeight:m.indexLabelFontWeight;k.indexLabelF
ontSize=g.indexLabelFontSize?g.indexLabelFontSize:m.indexLabelFontSize;k.indexLabelFo
ntFamily=g.indexLabelFontFamily?g.indexLabelFontFamily:m.indexLabelFontFamily;k.ind
exLabelBackgroundColor=g.indexLabelBackgroundColor?g.indexLabelBackgroundColor:m.
options.indexLabelBackgroundColor?m.options.indexLabelBackgroundColor:m.indexLabel
BackgroundColor;k.indexLabelMaxWidth=g.indexLabelMaxWidth?g.indexLabelMaxWidth:
m.indexLabelMaxWidth?

m.indexLabelMaxWidth:0.33*e.width;k.indexLabelWrap="undefined"!==typeof
g.indexLabelWrap?g.indexLabelWrap:m.indexLabelWrap;k.startAngle=0===f?m.startAngle

155
Chatbot designing

?m.startAngle/180*Math.PI:0:r[f-
1].endAngle;k.startAngle=(k.startAngle+2*Math.PI)%(2*Math.PI);k.endAngle=k.startAngle
+2*Math.PI/v*Math.abs(g.y);g=(k.endAngle+k.startAngle)/2;g=(g+2*Math.PI)%(2*Math.PI
);k.midAngle=g;if(k.midAngle>Math.PI/2-
w&&k.midAngle<Math.PI/2+w){if(0===a||r[c].midAngle>k.midAngle)c=f;a++}else
if(k.midAngle>3*Math.PI/2-w&&k.midAngle<

3*Math.PI/2+w){if(0===b||r[d].midAngle>k.midAngle)d=f;b++}k.hemisphere=g>Math.PI/2
&&g<=3*Math.PI/2?"left":"right";k.indexLabelTextBlock=new
W(l.plotArea.ctx,{fontSize:k.indexLabelFontSize,fontFamily:k.indexLabelFontFamily,fontC
olor:k.indexLabelFontColor,fontStyle:k.indexLabelFontStyle,fontWeight:k.indexLabelFont
Weight,horizontalAlign:"left",backgroundColor:k.indexLabelBackgroundColor,maxWidth:k.
indexLabelMaxWidth,maxHeight:k.indexLabelWrap?5*k.indexLabelFontSize:1.5*k.indexLa
belFontSize,text:k.indexLabelText,

padding:0,textBaseline:"top"});k.indexLabelTextBlock.measureText()}h=g=0;p=!1;for(f=0;f
<n.length;f++)k=r[(c+f)%n.length],1<a&&(k.midAngle>Math.PI/2-
w&&k.midAngle<Math.PI/2+w)&&(g<=a/2&&!p?(k.hemisphere="right",g++):(k.hemispher
e="left",p=!0));p=!1;for(f=0;f<n.length;f++)k=r[(d+f)%n.length],1<b&&(k.midAngle>3*Ma
th.PI/2-
w&&k.midAngle<3*Math.PI/2+w)&&(h<=b/2&&!p?(k.hemisphere="left",h++):(k.hemisph
ere="right",p=!0))}}function b(a){var
b=l.plotArea.ctx;b.clearRect(e.x1,e.y1,e.width,e.height);b.fillStyle=

l.backgroundColor;b.fillRect(e.x1,e.y1,e.width,e.height);for(b=0;b<n.length;b++){var
c=r[b].startAngle,d=r[b].endAngle;if(d>c){var
f=0.07*B*Math.cos(r[b].midAngle),g=0.07*B*Math.sin(r[b].midAngle),k=!1;if(n[b].explode
d){if(1E-9<Math.abs(r[b].center.x-(t.x+f))||1E-9<Math.abs(r[b].center.y-
(t.y+g)))r[b].center.x=t.x+f*a,r[b].center.y=t.y+g*a,k=!0}else if(0<Math.abs(r[b].center.x-
t.x)||0<Math.abs(r[b].center.y-t.y))r[b].center.x=t.x+f*(1-a),r[b].center.y=t.y+g*(1-
a),k=!0;k&&(f={},f.dataSeries=m,f.dataPoint=

m.dataPoints[b],f.index=b,l.toolTip.highlightObjects([f]));Ha(l.plotArea.ctx,r[b].center,r[b].ra
dius,n[b].color?n[b].color:m._colorSet[b%m._colorSet.length],m.type,c,d,m.fillOpacity,r[b].p
ercentInnerRadius)}}a=l.plotArea.ctx;a.save();a.fillStyle="black";a.strokeStyle="grey";a.text
Baseline="middle";a.lineJoin="round";for(b=b=0;b<n.length;b++)c=r[b],c.indexLabelText&

156
Chatbot designing

&(c.indexLabelTextBlock.y-
=c.indexLabelTextBlock.height/2,d=0,d="left"===c.hemisphere?"inside"!==m.indexLabelPl
acement?-(c.indexLabelTextBlock.width+

p):-c.indexLabelTextBlock.width/2:"inside"!==m.indexLabelPlacement?p:-
c.indexLabelTextBlock.width/2,c.indexLabelTextBlock.x+=d,c.indexLabelTextBlock.render(
!0),c.indexLabelTextBlock.x-
=d,c.indexLabelTextBlock.y+=c.indexLabelTextBlock.height/2,"inside"!==c.indexLabelPlac
ement&&0<c.indexLabelLineThickness&&(d=c.center.x+B*Math.cos(c.midAngle),f=c.cent
er.y+B*Math.sin(c.midAngle),a.strokeStyle=c.indexLabelLineColor,a.lineWidth=c.indexLab
elLineThickness,a.setLineDash&&a.setLineDash(I(c.indexLabelLineDashType,

c.indexLabelLineThickness)),a.beginPath(),a.moveTo(d,f),a.lineTo(c.indexLabelTextBlock.x
,c.indexLabelTextBlock.y),a.lineTo(c.indexLabelTextBlock.x+("left"===c.hemisphere?-
p:p),c.indexLabelTextBlock.y),a.stroke()),a.lineJoin="miter");a.save()}function d(a,b){var
c=0,c=a.indexLabelTextBlock.y-
a.indexLabelTextBlock.height/2,d=a.indexLabelTextBlock.y+a.indexLabelTextBlock.height/
2,e=b.indexLabelTextBlock.y-
b.indexLabelTextBlock.height/2,f=b.indexLabelTextBlock.y+b.indexLabelTextBlock.height/
2;return c=

b.indexLabelTextBlock.y>a.indexLabelTextBlock.y?e-d:c-f}function f(a){for(var
b=null,c=1;c<n.length;c++)if(b=(a+c+r.length)%r.length,r[b].hemisphere!==r[a].hemisphere)
{b=null;break}else
if(r[b].indexLabelText&&b!==a&&(0>d(r[b],r[a])||("right"===r[a].hemisphere?r[b].indexLa
belTextBlock.y>=r[a].indexLabelTextBlock.y:r[b].indexLabelTextBlock.y<=r[a].indexLabel
TextBlock.y)))break;else b=null;return b}function g(a,b,c){c=(c||0)+1;if(1E3<c)return
0;b=b||0;var e=0,k=t.y-1*s,l=t.y+1*s;if(0<=a&&a<n.length){var h=

r[a];if(0>b&&h.indexLabelTextBlock.y<k||0<b&&h.indexLabelTextBlock.y>l)return 0;var
m=0,p=0,p=m=m=0;0>b?h.indexLabelTextBlock.y-
h.indexLabelTextBlock.height/2>k&&h.indexLabelTextBlock.y-
h.indexLabelTextBlock.height/2+b<k&&(b=-(k-(h.indexLabelTextBlock.y-
h.indexLabelTextBlock.height/2+b))):h.indexLabelTextBlock.y+h.indexLabelTextBlock.heig
ht/2<k&&h.indexLabelTextBlock.y+h.indexLabelTextBlock.height/2+b>l&&(b=h.indexLab
elTextBlock.y+h.indexLabelTextBlock.height/2+b-l);b=h.indexLabelTextBlock.y+b;k=

157
Chatbot designing

0;k="right"===h.hemisphere?t.x+Math.sqrt(Math.pow(s,2)-Math.pow(b-t.y,2)):t.x-
Math.sqrt(Math.pow(s,2)-Math.pow(b-
t.y,2));p=t.x+B*Math.cos(h.midAngle);m=t.y+B*Math.sin(h.midAngle);m=Math.sqrt(Math.
pow(k-p,2)+Math.pow(b-m,2));p=Math.acos(B/s);m=Math.acos((s*s+B*B-
m*m)/(2*B*s));b=m<p?b-h.indexLabelTextBlock.y:0;k=null;for(l=1;l<n.length;l++)if(k=(a-
l+r.length)%r.length,r[k].hemisphere!==r[a].hemisphere){k=null;break}else
if(r[k].indexLabelText&&r[k].hemisphere===r[a].hemisphere&&k!==a&&(0>d(r[k],r[a])||

("right"===r[a].hemisphere?r[k].indexLabelTextBlock.y<=r[a].indexLabelTextBlock.y:r[k].i
ndexLabelTextBlock.y>=r[a].indexLabelTextBlock.y)))break;else
k=null;p=k;m=f(a);l=k=0;0>b?(l="right"===h.hemisphere?p:m,e=b,null!==l&&(p=-
b,b=h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2-
(r[l].indexLabelTextBlock.y+r[l].indexLabelTextBlock.height/2),b-p<q&&(k=-
p,l=g(l,k,c+1),+l.toFixed(y)>+k.toFixed(y)&&(e=b>q?-(b-q):-(p-(l-
k)))))):0<b&&(l="right"===h.hemisphere?m:p,e=b,null!==l&&(p=b,b=r[l].indexLabelTextB
lock.y-

r[l].indexLabelTextBlock.height/2-
(h.indexLabelTextBlock.y+h.indexLabelTextBlock.height/2),b-
p<q&&(k=p,l=g(l,k,c+1),+l.toFixed(y)<+k.toFixed(y)&&(e=b>q?b-q:p-(k-
l)))));e&&(c=h.indexLabelTextBlock.y+e,b=0,b="right"===h.hemisphere?t.x+Math.sqrt(Mat
h.pow(s,2)-Math.pow(c-t.y,2)):t.x-Math.sqrt(Math.pow(s,2)-Math.pow(c-
t.y,2)),h.midAngle>Math.PI/2-w&&h.midAngle<Math.PI/2+w?(k=(a-
1+r.length)%r.length,k=r[k],a=r[(a+1+r.length)%r.length],"left"===h.hemisphere&&"right"=
==k.hemisphere&&b>k.indexLabelTextBlock.x?

b=k.indexLabelTextBlock.x-
15:"right"===h.hemisphere&&("left"===a.hemisphere&&b<a.indexLabelTextBlock.x)&&(b
=a.indexLabelTextBlock.x+15)):h.midAngle>3*Math.PI/2-
w&&h.midAngle<3*Math.PI/2+w&&(k=(a-
1+r.length)%r.length,k=r[k],a=r[(a+1+r.length)%r.length],"right"===h.hemisphere&&"left"=
==k.hemisphere&&b<k.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x+15:"left"===h.
hemisphere&&("right"===a.hemisphere&&b>a.indexLabelTextBlock.x)&&(b=a.indexLabel
TextBlock.x-15)),h.indexLabelTextBlock.y=c,h.indexLabelTextBlock.x=

158
Chatbot designing

b,h.indexLabelAngle=Math.atan2(h.indexLabelTextBlock.y-t.y,h.indexLabelTextBlock.x-
t.x))}return e}function h(){var
a=l.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px
Arial";a.textBaseline="middle";for(var
b=a=0,c=0,k=!0,b=0;10>b&&(1>b||0<c);b++){if(m.radius||!m.radius&&"undefined"!==type
of m.innerRadius&&null!==m.innerRadius&&B-c<=E)k=!1;k&&(B-
=c);c=0;if("inside"!==m.indexLabelPlacement){s=B*u;for(a=0;a<n.length;a++){var
h=r[a];h.indexLabelTextBlock.x=t.x+s*Math.cos(h.midAngle);

h.indexLabelTextBlock.y=t.y+s*Math.sin(h.midAngle);h.indexLabelAngle=h.midAngle;h.ra
dius=B;h.percentInnerRadius=F}for(var w,v,a=0;a<n.length;a++){var
h=r[a],x=f(a);if(null!==x){w=r[a];v=r[x];var z=0,z=d(w,v)-q;if(0>z){for(var
A=v=0,D=0;D<n.length;D++)D!==a&&r[D].hemisphere===h.hemisphere&&(r[D].indexLa
belTextBlock.y<h.indexLabelTextBlock.y?v++:A++);v=z/(v+A||1)*A;var A=-1*(z-
v),C=D=0;"right"===h.hemisphere?(D=g(a,v),A=-1*(z-
D),C=g(x,A),+C.toFixed(y)<+A.toFixed(y)&&+D.toFixed(y)<=+v.toFixed(y)&&g(a,

-(A-C))):(D=g(x,v),A=-1*(z-
D),C=g(a,A),+C.toFixed(y)<+A.toFixed(y)&&+D.toFixed(y)<=+v.toFixed(y)&&g(x,-(A-
C)))}}}}else
for(a=0;a<n.length;a++)h=r[a],s="pie"===m.type?0.7*B:0.8*B,x=t.x+s*Math.cos(h.midAngl
e),v=t.y+s*Math.sin(h.midAngle),h.indexLabelTextBlock.x=x,h.indexLabelTextBlock.y=v;f
or(a=0;a<n.length;a++)if(h=r[a],x=h.indexLabelTextBlock.measureText(),0!==x.height&&0!
==x.width)x=x=0,"right"===h.hemisphere?(x=e.x2-
(h.indexLabelTextBlock.x+h.indexLabelTextBlock.width+p),x*=-1):x=e.x1-
(h.indexLabelTextBlock.x-

h.indexLabelTextBlock.width-
p),0<x&&(!k&&h.indexLabelText&&(v="right"===h.hemisphere?e.x2-
h.indexLabelTextBlock.x:h.indexLabelTextBlock.x-
e.x1,0.3*h.indexLabelTextBlock.maxWidth>v?h.indexLabelText="":h.indexLabelTextBlock.
maxWidth=0.85*v,0.3*h.indexLabelTextBlock.maxWidth<v&&(h.indexLabelTextBlock.x-
="right"===h.hemisphere?2:-2)),Math.abs(h.indexLabelTextBlock.y-
h.indexLabelTextBlock.height/2-

159
Chatbot designing

t.y)<B||Math.abs(h.indexLabelTextBlock.y+h.indexLabelTextBlock.height/2-
t.y)<B)&&(x/=Math.abs(Math.cos(h.indexLabelAngle)),

9<x&&(x*=0.3),x>c&&(c=x)),x=x=0,0<h.indexLabelAngle&&h.indexLabelAngle<Math.PI
?(x=e.y2-(h.indexLabelTextBlock.y+h.indexLabelTextBlock.height/2+5),x*=-1):x=e.y1-
(h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2-
5),0<x&&(!k&&h.indexLabelText&&(v=0<h.indexLabelAngle&&h.indexLabelAngle<Mat
h.PI?-1:1,0===g(a,x*v)&&g(a,2*v)),Math.abs(h.indexLabelTextBlock.x-
t.x)<B&&(x/=Math.abs(Math.sin(h.indexLabelAngle)),9<x&&(x*=0.3),x>c&&(c=x)));var
G=function(a,b,c){for(var d=[],e=0;d.push(r[b]),b!==c;b=(b+1+

n.length)%n.length);d.sort(function(a,b){return a.y-
b.y});for(b=0;b<d.length;b++)if(c=d[b],e<0.7*a)e+=c.indexLabelTextBlock.height,c.indexLa
belTextBlock.text="",c.indexLabelText="",c.indexLabelTextBlock.measureText();else
break};(function(){for(var a=-1,b=-
1,c=0,e=!1,g=0;g<n.length;g++)if(e=!1,w=r[g],w.indexLabelText){var
h=f(g);if(null!==h){var k=r[h];z=0;z=d(w,k);var l;if(l=0>z){l=w.indexLabelTextBlock.x;var
m=w.indexLabelTextBlock.y-
w.indexLabelTextBlock.height/2,q=w.indexLabelTextBlock.y+w.indexLabelTextBlock.heig
ht/

2,s=k.indexLabelTextBlock.y-
k.indexLabelTextBlock.height/2,t=k.indexLabelTextBlock.x+k.indexLabelTextBlock.width,
u=k.indexLabelTextBlock.y+k.indexLabelTextBlock.height/2;l=w.indexLabelTextBlock.x+
w.indexLabelTextBlock.width<k.indexLabelTextBlock.x-p||l>t+p||m>u+p||q<s-
p?!1:!0}l?(0>a&&(a=g),h!==a&&(b=h,c+=-
z),0===g%Math.max(n.length/10,3)&&(e=!0)):e=!0;e&&(0<c&&0<=a&&0<=b)&&(G(c,a,
b),b=a=-1,c=0)}}0<c&&G(c,a,b)})()}}function
k(){l.plotArea.layoutManager.reset();l.title&&(l.title.dockInsidePlotArea||

"center"===l.title.horizontalAlign&&"center"===l.title.verticalAlign)&&l.title.render();if(l.s
ubtitles)for(var a=0;a<l.subtitles.length;a++){var
b=l.subtitles[a];(b.dockInsidePlotArea||"center"===b.horizontalAlign&&"center"===b.vertic
alAlign)&&b.render()}l.legend&&(l.legend.dockInsidePlotArea||"center"===l.legend.horizo
ntalAlign&&"center"===l.legend.verticalAlign)&&l.legend.render();z.fNg&&z.fNg(l)}var

160
Chatbot designing

l=this;if(!(0>=a.dataSeriesIndexes.length)){var
m=this.data[a.dataSeriesIndexes[0]],n=m.dataPoints,

p=10,e=this.plotArea,r=[],q=2,s,u=1.3,w=20/180*Math.PI,y=6,t={x:(e.x2+e.x1)/2,y:(e.y2+e.
y1)/2},v=0;a=!1;for(var
A=0;A<n.length;A++)v+=Math.abs(n[A].y),!a&&("undefined"!==typeof
n[A].indexLabel&&null!==n[A].indexLabel&&0<n[A].indexLabel.toString().length)&&(a=!
0),!a&&("undefined"!==typeof
n[A].label&&null!==n[A].label&&0<n[A].label.toString().length)&&(a=!0);if(0!==v){a=a||"
undefined"!==typeof
m.indexLabel&&null!==m.indexLabel&&0<m.indexLabel.toString().length;var
B="inside"!==m.indexLabelPlacement&&

a?0.75*Math.min(e.width,e.height)/2:0.92*Math.min(e.width,e.height)/2;m.radius&&(B=Oa(
m.radius,B));var E="undefined"!==typeof
m.innerRadius&&null!==m.innerRadius?Oa(m.innerRadius,B):0.7*B;m.radius=B;"doughnut
"===m.type&&(m.innerRadius=E);var F=Math.min(E/B,(B-
1)/B);this.pieDoughnutClickHandler=function(a){l.isAnimating||!x(a.dataSeries.explodeOnCl
ick)&&!a.dataSeries.explodeOnClick||(a=a.dataPoint,a.exploded=a.exploded?!1:!0,1<this.dat
aPoints.length&&l._animator.animate(0,500,function(a){b(a);k()}))};

c();h();h();h();h();this.disableToolTip=!0;this._animator.animate(0,this.animatedRender?this.
animationDuration:0,function(a){var
b=l.plotArea.ctx;b.clearRect(e.x1,e.y1,e.width,e.height);b.fillStyle=l.backgroundColor;b.fillR
ect(e.x1,e.y1,e.width,e.height);a=r[0].startAngle+2*Math.PI*a;for(b=0;b<n.length;b++){var
c=0===b?r[b].startAngle:d,d=c+(r[b].endAngle-r[b].startAngle),f=!1;d>a&&(d=a,f=!0);var
g=n[b].color?n[b].color:m._colorSet[b%m._colorSet.length];d>c&&Ha(l.plotArea.ctx,r[b].ce
nter,r[b].radius,

g,m.type,c,d,m.fillOpacity,r[b].percentInnerRadius);if(f)break}k()},function(){l.disableToolT
ip=!1;l._animator.animate(0,l.animatedRender?500:0,function(a){b(a);k()})})}}};A.prototyp
e.animationRequestId=null;A.prototype.requestAnimFrame=function(){return
window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequ
estAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame
||function(a){window.setTimeout(a,1E3/60)}}();A.prototype.cancelRequestAnimFrame=win
dow.cancelAnimationFrame||

161
Chatbot designing

window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame
||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clear
Timeout;A.prototype.set=function(a,c,b){b="undefined"===typeof
b?!0:b;"options"===a?(this.options=c,b&&this.render()):A.base.set.call(this,a,c,b)};A.protot
ype.exportChart=function(a){a="undefined"===typeof a?{}:a;var
c=a.format?a.format:"png",b=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)re
turn this.canvas.toDataURL("image/"+

c);Ca(this.canvas,c,b)};A.prototype.print=function(){var
a=this.exportChart({toDataURL:!0}),c=document.createElement("iframe");c.setAttribute("cl
ass","canvasjs-chart-print-frame");c.setAttribute("style","position:absolute; width:100%;
border: 0px; margin: 0px 0px 0px 0px; padding 0px 0px 0px
0px;");c.style.height=this.height+"px";this._canvasJSContainer.appendChild(c);var
b=this,d=c.contentWindow||c.contentDocument.document||c.contentDocument;d.document.o
pen();d.document.write('<!DOCTYPE HTML>\n<html><body style="margin: 0px 0px 0px
0px; padding: 0px 0px 0px 0px;"><img src="'+

a+'"/><body/></html>');d.document.close();setTimeout(function(){d.focus();d.print();setTim
eout(function(){b._canvasJSContainer.removeChild(c)},1E3)},500)};ia.prototype.registerSpa
ce=function(a,c){"top"===a?this._topOccupied+=c.height:"bottom"===a?this._bottomOccup
ied+=c.height:"left"===a?this._leftOccupied+=c.width:"right"===a&&(this._rightOccupied+
=c.width)};ia.prototype.unRegisterSpace=function(a,c){"top"===a?this._topOccupied-
=c.height:"bottom"===a?this._bottomOccupied-=c.height:"left"===a?this._leftOccupied-=

c.width:"right"===a&&(this._rightOccupied-
=c.width)};ia.prototype.getFreeSpace=function(){return{x1:this._x1+this._leftOccupied,y1:t
his._y1+this._topOccupied,x2:this._x2-this._rightOccupied,y2:this._y2-
this._bottomOccupied,width:this._x2-this._x1-this._rightOccupied-
this._leftOccupied,height:this._y2-this._y1-this._bottomOccupied-
this._topOccupied}};ia.prototype.reset=function(){this._rightOccupied=this._leftOccupied=t
his._bottomOccupied=this._topOccupied=this._padding};U(W,M);W.prototype.render=

function(a){a&&this.ctx.save();var c=this.ctx.font;this.ctx.textBaseline=this.textBaseline;var
b=0;this._isDirty&&this.measureText(this.ctx);this.ctx.translate(this.x,this.y+b);"middle"===
this.textBaseline&&(b=-
this._lineHeight/2);this.ctx.font=this._getFontString();this.ctx.rotate(Math.PI/180*this.angle);

162
Chatbot designing

var
d=0,f=this.padding,g=null;(0<this.borderThickness&&this.borderColor||this.backgroundColo
r)&&this.ctx.roundRect(0,b,this.width,this.height,this.cornerRadius,this.borderThickness,this
.backgroundColor,

this.borderColor);this.ctx.fillStyle=this.fontColor;for(b=0;b<this._wrappedText.lines.length;b
++)g=this._wrappedText.lines[b],"right"===this.horizontalAlign?d=this.width-g.width-
this.padding:"left"===this.horizontalAlign?d=this.padding:"center"===this.horizontalAlign&
&(d=(this.width-2*this.padding)/2-
g.width/2+this.padding),this.ctx.fillText(g.text,d,f),f+=g.height;this.ctx.font=c;a&&this.ctx.re
store()};W.prototype.setText=function(a){this.text=a;this._isDirty=!0;this._wrappedText=nul
l};W.prototype.measureText=

function(){this._lineHeight=Ka(this.fontFamily,this.fontSize,this.fontWeight);if(null===this.
maxWidth)throw"Please set maxWidth and height for
TextBlock";this._wrapText(this.ctx);this._isDirty=!1;return{width:this.width,height:this.heig
ht}};W.prototype._getLineWithWidth=function(a,c,b){a=String(a);if(!a)return{text:"",width:
0};var d=b=0,f=a.length-1,g=Infinity;for(this.ctx.font=this._getFontString();d<=f;){var
g=Math.floor((d+f)/2),h=a.substr(0,g+1);b=this.ctx.measureText(h).width;if(b<c)d=g+1;else
if(b>

c)f=g-1;else break}b>c&&1<h.length&&(h=h.substr(0,h.length-
1),b=this.ctx.measureText(h).width);c=!0;if(h.length===a.length||"
"===a[h.length])c=!1;c&&(a=h.split(" "),1<a.length&&a.pop(),h=a.join("
"),b=this.ctx.measureText(h).width);return{text:h,width:b}};W.prototype._wrapText=functio
n(){var a=new
String(la(String(this.text))),c=[],b=this.ctx.font,d=0,f=0;for(this.ctx.font=this._getFontString(
);0<a.length;){var g=this.maxHeight-
2*this.padding,h=this._getLineWithWidth(a,this.maxWidth-2*this.padding,

!1);h.height=this._lineHeight;c.push(h);var
k=f,f=Math.max(f,h.width),d=d+h.height,a=la(a.slice(h.text.length,a.length));g&&d>g&&(h
=c.pop(),d-
=h.height,f=k)}this._wrappedText={lines:c,width:f,height:d};this.width=f+2*this.padding;thi
s.height=d+2*this.padding;this.ctx.font=b};W.prototype._getFontString=function(){var
a;a=""+(this.fontStyle?this.fontStyle+" ":"");a+=this.fontWeight?this.fontWeight+"

163
Chatbot designing

":"";a+=this.fontSize?this.fontSize+"px ":"";var
c=this.fontFamily?this.fontFamily+"":"";!v&&c&&(c=c.split(",")[0],

"'"!==c[0]&&'"'!==c[0]&&(c="'"+c+"'"));return
a+=c};U(na,M);na.prototype.render=function(){if(this.text){var
a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,c=a.layoutManager.getFreeSpace(),b
=c.x1,d=c.y1,f=0,g=0,h=this.chart._menuButton&&this.chart.exportEnabled&&"top"===this
.verticalAlign?22:0,k,l;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(null===th
is.maxWidth&&(this.maxWidth=c.width-4-
h*("center"===this.horizontalAlign?2:1)),g=0.5*c.height-this.margin-2,f=0):"center"===

this.verticalAlign&&("left"===this.horizontalAlign||"right"===this.horizontalAlign?(null===
this.maxWidth&&(this.maxWidth=c.height-4),g=0.5*c.width-this.margin-
2):"center"===this.horizontalAlign&&(null===this.maxWidth&&(this.maxWidth=c.width-
4),g=0.5*c.height-
4));this.wrap||(g=Math.min(g,Math.max(1.5*this.fontSize,this.fontSize+2.5*this.padding)));v
ar g=new
W(this.ctx,{fontSize:this.fontSize,fontFamily:this.fontFamily,fontColor:this.fontColor,fontSt
yle:this.fontStyle,fontWeight:this.fontWeight,horizontalAlign:this.horizontalAlign,

verticalAlign:this.verticalAlign,borderColor:this.borderColor,borderThickness:this.borderThi
ckness,backgroundColor:this.backgroundColor,maxWidth:this.maxWidth,maxHeight:g,corne
rRadius:this.cornerRadius,text:this.text,padding:this.padding,textBaseline:"top"}),m=g.measu
reText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAli
gn?(d=c.y1+2,l="top"):"bottom"===this.verticalAlign&&(d=c.y2-2-
m.height,l="bottom"),"left"===this.horizontalAlign?b=c.x1+2:"center"===this.horizontalAli
gn?

b=c.x1+c.width/2-m.width/2:"right"===this.horizontalAlign&&(b=c.x2-2-m.width-
h),k=this.horizontalAlign,this.width=m.width,this.height=m.height):"center"===this.vertical
Align&&("left"===this.horizontalAlign?(b=c.x1+2,d=c.y2-2-(this.maxWidth/2-
m.width/2),f=-
90,l="left",this.width=m.height,this.height=m.width):"right"===this.horizontalAlign?(b=c.x2
-2,d=c.y1+2+(this.maxWidth/2-
m.width/2),f=90,l="right",this.width=m.height,this.height=m.width):"center"===this.horizont
alAlign&&(d=a.y1+(a.height/2-m.height/

164
Chatbot designing

2),b=a.x1+(a.width/2-
m.width/2),l="center",this.width=m.width,this.height=m.height),k="center");g.x=b;g.y=d;g.a
ngle=f;g.horizontalAlign=k;g.render(!0);a.layoutManager.registerSpace(l,{width:this.width+(
"left"===l||"right"===l?this.margin+2:0),height:this.height+("top"===l||"bottom"===l?this.m
argin+2:0)});this.bounds={x1:b,y1:d,x2:b+this.width,y2:d+this.height};this.ctx.textBaseline=
"top"}};U(wa,M);wa.prototype.render=na.prototype.render;U(xa,M);xa.prototype.render=fun
ction(){var a=this.dockInsidePlotArea?

this.chart.plotArea:this.chart,c=a.layoutManager.getFreeSpace(),b=null,d=0,f=0,g=0,h=0,k=t
his.markerMargin=this.chart.options.legend&&!x(this.chart.options.legend.markerMargin)?t
his.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var
l=[],m=[];"top"===this.verticalAlign||"bottom"===this.verticalAlign?(this.orientation="horiz
ontal",b=this.verticalAlign,g=this.maxWidth=null!==this.maxWidth?this.maxWidth:c.width,
h=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*c.height):"center"===

this.verticalAlign&&(this.orientation="vertical",b=this.horizontalAlign,g=this.maxWidth=nu
ll!==this.maxWidth?this.maxWidth:0.5*c.width,h=this.maxHeight=null!==this.maxHeight?t
his.maxHeight:c.height);for(var n=0;n<this.dataSeries.length;n++){var
p=this.dataSeries[n];if("pie"!==p.type&&"doughnut"!==p.type&&"funnel"!==p.type){var
e=p.legendMarkerType=p.legendMarkerType?p.legendMarkerType:"line"!==p.type&&"step
Line"!==p.type&&"spline"!==p.type&&"scatter"!==p.type&&"bubble"!==p.type||!p.marker
Type?$.getDefaultLegendMarker(p.type):

p.markerType,r=p.legendText?p.legendText:this.itemTextFormatter?this.itemTextFormatter(
{chart:this.chart,legend:this.options,dataSeries:p,dataPoint:null}):p.name,q=p.legendMarker
Color=p.legendMarkerColor?p.legendMarkerColor:p.markerColor?p.markerColor:p._colorSe
t[0],s=p.markerSize||"line"!==p.type&&"stepLine"!==p.type&&"spline"!==p.type?0.75*this.
lineHeight:0,u=p.legendMarkerBorderColor?p.legendMarkerBorderColor:p.markerBorderCo
lor,w=p.legendMarkerBorderThickness?p.legendMarkerBorderThickness:p.markerBorderThi
ckness?

Math.max(1,Math.round(0.2*s)):0,r=this.chart.replaceKeywordsWithValue(r,p.dataPoints[0],
p,n),e={markerType:e,markerColor:q,text:r,textBlock:null,chartType:p.type,markerSize:s,lin
eColor:p._colorSet[0],dataSeriesIndex:p.index,dataPointIndex:null,markerBorderColor:u,mar
kerBorderThickness:w};l.push(e)}else for(var v=0;v<p.dataPoints.length;v++){var

165
Chatbot designing

t=p.dataPoints[v],e=t.legendMarkerType?t.legendMarkerType:p.legendMarkerType?p.legend
MarkerType:$.getDefaultLegendMarker(p.type),r=t.legendText?t.legendText:

p.legendText?p.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,l
egend:this.options,dataSeries:p,dataPoint:t}):t.name?t.name:"DataPoint:
"+(v+1),q=t.legendMarkerColor?t.legendMarkerColor:p.legendMarkerColor?p.legendMarker
Color:t.color?t.color:p.color?p.color:p._colorSet[v%p._colorSet.length],s=0.75*this.lineHeig
ht,u=t.legendMarkerBorderColor?t.legendMarkerBorderColor:p.legendMarkerBorderColor?p
.legendMarkerBorderColor:t.markerBorderColor?t.markerBorderColor:p.markerBorderColor
,

w=t.legendMarkerBorderThickness?t.legendMarkerBorderThickness:p.legendMarkerBorder
Thickness?p.legendMarkerBorderThickness:t.markerBorderThickness||p.markerBorderThick
ness?Math.max(1,Math.round(0.2*s)):0,r=this.chart.replaceKeywordsWithValue(r,t,p,v),e={
markerType:e,markerColor:q,text:r,textBlock:null,chartType:p.type,markerSize:s,dataSeriesI
ndex:n,dataPointIndex:v,markerBorderColor:u,markerBorderThickness:w};(t.showInLegend||
p.showInLegend&&!1!==t.showInLegend)&&l.push(e)}}!0===this.reversed&&l.reverse();

if(0<l.length){p=null;q=v=r=t=0;r=null!==this.itemWidth?null!==this.itemMaxWidth?Math.
min(this.itemWidth,this.itemMaxWidth,g):this.itemMaxWidth=Math.min(this.itemWidth,g):
null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,g):this.itemMaxWidth=g;s=0===s
?0.75*this.lineHeight:s;r-
=s+k;for(n=0;n<l.length;n++){e=l[n];if("line"===e.chartType||"spline"===e.chartType||"step
Line"===e.chartType)r-=2*0.1*this.lineHeight;if(!(0>=h||"undefined"===typeof
h||0>=r||"undefined"===typeof r)){if("horizontal"===this.orientation){e.textBlock=

new
W(this.ctx,{x:0,y:0,maxWidth:r,maxHeight:this.itemWrap?h:this.lineHeight,angle:0,text:e.te
xt,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fo
ntWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});e.textBloc
k.measureText();null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-
(s+k+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.
lineHeight:0)));if(!p||p.width+Math.round(e.textBlock.width+

s+k+(0===p.width?0:this.horizontalSpacing)+("line"===e.chartType||"spline"===e.chartTyp
e||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))>g)p={items:[],width:0},m.push(p),thi

166
Chatbot designing

s.height+=v,v=0;v=Math.max(v,e.textBlock.height)}else e.textBlock=new
W(this.ctx,{x:0,y:0,maxWidth:r,maxHeight:!0===this.itemWrap?h:1.5*this.fontSize,angle:0,
text:e.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeigh
t:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),

e.textBlock.measureText(),null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-
(s+k+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.
lineHeight:0))),this.height<h-
this.lineHeight?(p={items:[],width:0},m.push(p)):(p=m[t],t=(t+1)%m.length),this.height+=e.t
extBlock.height;e.textBlock.x=p.width;e.textBlock.y=0;p.width+=Math.round(e.textBlock.wi
dth+s+k+(0===p.width?0:this.horizontalSpacing)+("line"===e.chartType||"spline"===e.chart
Type||"stepLine"===e.chartType?2*

0.1*this.lineHeight:0));p.items.push(e);this.width=Math.max(p.width,this.width);q=e.textBlo
ck.width+(s+k+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2
*0.1*this.lineHeight:0))}}this.itemWidth=q;this.height=!1===this.itemWrap?m.length*this.li
neHeight:this.height+v;this.height=Math.min(h,this.height);this.width=Math.min(g,this.width
)}"top"===this.verticalAlign?(f="left"===this.horizontalAlign?c.x1:"right"===this.horizonta
lAlign?c.x2-this.width:c.x1+c.width/2-this.width/2,

d=c.y1):"center"===this.verticalAlign?(f="left"===this.horizontalAlign?c.x1:"right"===this.
horizontalAlign?c.x2-this.width:c.x1+c.width/2-this.width/2,d=c.y1+c.height/2-
this.height/2):"bottom"===this.verticalAlign&&(f="left"===this.horizontalAlign?c.x1:"right
"===this.horizontalAlign?c.x2-this.width:c.x1+c.width/2-this.width/2,d=c.y2-
this.height);this.items=l;for(n=0;n<this.items.length;n++)e=l[n],e.id=++this.chart._eventMan
ager.lastObjectId,this.chart._eventManager.objectMap[e.id]={id:e.id,objectType:"legendItem
",

legendItemIndex:n,dataSeriesIndex:e.dataSeriesIndex,dataPointIndex:e.dataPointIndex};(0<t
his.borderThickness&&this.borderColor||this.backgroundColor)&&this.ctx.roundRect(f,d,thi
s.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderC
olor);for(n=c=0;n<m.length;n++){p=m[n];for(t=v=0;t<p.items.length;t++){e=p.items[t];q=e.t
extBlock.x+f+(0===t?0.2*s:this.horizontalSpacing);u=d+c;r=q;this.chart.data[e.dataSeriesIn
dex].visible||(this.ctx.globalAlpha=0.5);this.ctx.save();

167
Chatbot designing

this.ctx.beginPath();this.ctx.rect(f,d,g,Math.max(h-
h%this.lineHeight,0));this.ctx.clip();if("line"===e.chartType||"stepLine"===e.chartType||"spli
ne"===e.chartType)this.ctx.strokeStyle=e.lineColor,this.ctx.lineWidth=Math.ceil(this.lineHei
ght/8),this.ctx.beginPath(),this.ctx.moveTo(q-
0.1*this.lineHeight,u+this.lineHeight/2),this.ctx.lineTo(q+0.85*this.lineHeight,u+this.lineHei
ght/2),this.ctx.stroke(),r-
=0.1*this.lineHeight;P.drawMarker(q+s/2,u+this.lineHeight/2,this.ctx,e.markerType,e.marker
Size,e.markerColor,

e.markerBorderColor,e.markerBorderThickness);e.textBlock.x=q+k+s;if("line"===e.chartTy
pe||"stepLine"===e.chartType||"spline"===e.chartType)e.textBlock.x+=0.1*this.lineHeight;e.
textBlock.y=Math.round(u+this.lineHeight/2);e.textBlock.render(!0);this.ctx.restore();v=0<t?
Math.max(v,e.textBlock.height):e.textBlock.height;this.chart.data[e.dataSeriesIndex].visible||
(this.ctx.globalAlpha=1);q=G(e.id);this.ghostCtx.fillStyle=q;this.ghostCtx.beginPath();this.g
hostCtx.fillRect(r,e.textBlock.y-this.lineHeight/

2,e.textBlock.x+e.textBlock.width-
r,e.textBlock.height);e.x1=this.chart._eventManager.objectMap[e.id].x1=r;e.y1=this.chart._e
ventManager.objectMap[e.id].y1=e.textBlock.y-
this.lineHeight/2;e.x2=this.chart._eventManager.objectMap[e.id].x2=e.textBlock.x+e.textBlo
ck.width;e.y2=this.chart._eventManager.objectMap[e.id].y2=e.textBlock.y+e.textBlock.heigh
t-
this.lineHeight/2}c+=v}0<l.length&&a.layoutManager.registerSpace(b,{width:this.width+2+
2,height:this.height+5+5});this.bounds={x1:f,y1:d,x2:f+this.width,

y2:d+this.height}};U(Da,M);Da.prototype.render=function(){var
a=this.chart.layoutManager.getFreeSpace();this.ctx.fillStyle="red";this.ctx.fillRect(a.x1,a.y1,
a.x2,a.y2)};U($,M);$.prototype.getDefaultAxisPlacement=function(){var
a=this.type;if("column"===a||"line"===a||"stepLine"===a||"spline"===a||"area"===a||"stepAr
ea"===a||"splineArea"===a||"stackedColumn"===a||"stackedLine"===a||"bubble"===a||"scatt
er"===a||"stackedArea"===a||"stackedColumn100"===a||"stackedLine100"===a||"stackedAr
ea100"===a||"candlestick"===

a||"ohlc"===a||"rangeColumn"===a||"rangeArea"===a||"rangeSplineArea"===a)return"norma
l";if("bar"===a||"stackedBar"===a||"stackedBar100"===a||"rangeBar"===a)return"xySwappe
d";if("pie"===a||"doughnut"===a||"funnel"===a)return"none";window.console.log("Unknow

168
Chatbot designing

n Chart Type: "+a);return


null};$.getDefaultLegendMarker=function(a){if("column"===a||"stackedColumn"===a||"stac
kedLine"===a||"bar"===a||"stackedBar"===a||"stackedBar100"===a||"bubble"===a||"scatter"
===a||"stackedColumn100"===a||"stackedLine100"===

a||"stepArea"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeBar"===a||"r
angeArea"===a||"rangeSplineArea"===a)return"square";if("line"===a||"stepLine"===a||"spli
ne"===a||"pie"===a||"doughnut"===a||"funnel"===a)return"circle";if("area"===a||"splineAre
a"===a||"stackedArea"===a||"stackedArea100"===a)return"triangle";window.console.log("U
nknown Chart Type: "+a);return
null};$.prototype.getDataPointAtX=function(a,c){if(!this.dataPoints||0===this.dataPoints.len
gth)return null;var b={dataPoint:null,

distance:Infinity,index:NaN},d=null,f=0,g=0,h=1,k=Infinity,l=0,m=0,n=0;"none"!==this.char
t.plotInfo.axisPlacement&&(this.axisX.logarithmic?(n=Math.log(this.dataPoints[this.dataPoi
nts.length-1].x/this.dataPoints[0].x),n=1<n?Math.min(Math.max((this.dataPoints.length-
1)/n*Math.log(a/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0):(n=this.dataPoints[this.
dataPoints.length-1].x-
this.dataPoints[0].x,n=0<n?Math.min(Math.max((this.dataPoints.length-1)/n*(a-
this.dataPoints[0].x)>>0,0),this.dataPoints.length):

0));for(;;){g=0<h?n+f:n-f;if(0<=g&&g<this.dataPoints.length){var
d=this.dataPoints[g],p=this.axisX.logarithmic?d.x>a?d.x/a:a/d.x:Math.abs(d.x-
a);p<b.distance&&(b.dataPoint=d,b.distance=p,b.index=g);d=p;d<=k?k=d:0<h?l++:m++;if(1
E3<l&&1E3<m)break}else if(0>n-f&&n+f>=this.dataPoints.length)break;-
1===h?(f++,h=1):h=-1}return
c||b.dataPoint.x!==a?c&&null!==b.dataPoint?b:null:b};$.prototype.getDataPointAtXY=funct
ion(a,c,b){if(!this.dataPoints||0===this.dataPoints.length||a<this.chart.plotArea.x1||a>this.char
t.plotArea.x2||

c<this.chart.plotArea.y1||c>this.chart.plotArea.y2)return null;b=b||!1;var
d=[],f=0,g=0,h=1,k=!1,l=Infinity,m=0,n=0,p=0;"none"!==this.chart.plotInfo.axisPlacement&
&(p=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:c}),thi
s.axisX.logarithmic?(g=Math.log(this.dataPoints[this.dataPoints.length-
1].x/this.dataPoints[0].x),p=1<g?Math.min(Math.max((this.dataPoints.length-

169
Chatbot designing

1)/g*Math.log(p/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0):(g=this.dataPoints[this.
dataPoints.length-

1].x-this.dataPoints[0].x,p=0<g?Math.min(Math.max((this.dataPoints.length-1)/g*(p-
this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){g=0<h?p+f:p-
f;if(0<=g&&g<this.dataPoints.length){var
e=this.chart._eventManager.objectMap[this.dataPointIds[g]],r=this.dataPoints[g],q=null;if(e)
{switch(this.type){case "column":case "stackedColumn":case "stackedColumn100":case
"bar":case "stackedBar":case "stackedBar100":case "rangeColumn":case
"rangeBar":a>=e.x1&&(a<=e.x2&&c>=e.y1&&c<=e.y2)&&(d.push({dataPoint:r,

dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-
a),Math.abs(e.y1-c),Math.abs(e.y2-c))}),k=!0);break;case "line":case "stepLine":case
"spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case
"splineArea":case "scatter":var
s=L("markerSize",r,this)||4,u=b?20:s,q=Math.sqrt(Math.pow(e.x1-a,2)+Math.pow(e.y1-
c,2));q<=u&&d.push({dataPoint:r,dataPointIndex:g,dataSeries:this,distance:q});g=Math.abs(
e.x1-a);g<=l?l=g:0<h?m++:n++;q<=s/2&&(k=!0);break;

case "rangeArea":case
"rangeSplineArea":s=L("markerSize",r,this)||4;u=b?20:s;q=Math.min(Math.sqrt(Math.pow(e.
x1-a,2)+Math.pow(e.y1-c,2)),Math.sqrt(Math.pow(e.x1-a,2)+Math.pow(e.y2-
c,2)));q<=u&&d.push({dataPoint:r,dataPointIndex:g,dataSeries:this,distance:q});g=Math.abs
(e.x1-a);g<=l?l=g:0<h?m++:n++;q<=s/2&&(k=!0);break;case
"bubble":s=e.size;q=Math.sqrt(Math.pow(e.x1-a,2)+Math.pow(e.y1-
c,2));q<=s/2&&(d.push({dataPoint:r,dataPointIndex:g,dataSeries:this,distance:q}),k=!0);brea
k;case "pie":case "doughnut":s=

e.center;u="doughnut"===this.type?e.percentInnerRadius*e.radius:0;q=Math.sqrt(Math.pow(
s.x-a,2)+Math.pow(s.y-c,2));q<e.radius&&q>u&&(q=Math.atan2(c-s.y,a-
s.x),0>q&&(q+=2*Math.PI),q=Number(((180*(q/Math.PI)%360+360)%360).toFixed(12)),s=
Number(((180*(e.startAngle/Math.PI)%360+360)%360).toFixed(12)),u=Number(((180*(e.en
dAngle/Math.PI)%360+360)%360).toFixed(12)),0===u&&1<e.endAngle&&(u=360),s>=u&
&0!==r.y&&(u+=360,q<s&&(q+=360)),q>s&&q<u&&(d.push({dataPoint:r,dataPointIndex:
g,dataSeries:this,distance:0}),

170
Chatbot designing

k=!0));break;case "candlestick":if(a>=e.x1-
e.borderThickness/2&&a<=e.x2+e.borderThickness/2&&c>=e.y2-
e.borderThickness/2&&c<=e.y3+e.borderThickness/2||Math.abs(e.x2-a+e.x1-
a)<e.borderThickness&&c>=e.y1&&c<=e.y4)d.push({dataPoint:r,dataPointIndex:g,dataSerie
s:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y2-c),Math.abs(e.y3-
c))}),k=!0;break;case "ohlc":if(Math.abs(e.x2-a+e.x1-
a)<e.borderThickness&&c>=e.y2&&c<=e.y3||a>=e.x1&&a<=(e.x2+e.x1)/2&&c>=e.y1-
e.borderThickness/2&&c<=e.y1+

e.borderThickness/2||a>=(e.x1+e.x2)/2&&a<=e.x2&&c>=e.y4-
e.borderThickness/2&&c<=e.y4+e.borderThickness/2)d.push({dataPoint:r,dataPointIndex:g,
dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y2-
c),Math.abs(e.y3-c))}),k=!0}if(k||1E3<m&&1E3<n)break}}else if(0>p-
f&&p+f>=this.dataPoints.length)break;-1===h?(f++,h=1):h=-
1}a=null;for(c=0;c<d.length;c++)a?d[c].distance<=a.distance&&(a=d[c]):a=d[c];return
a};$.prototype.getMarkerProperties=function(a,c,b,d){var f=this.dataPoints;

return{x:c,y:b,ctx:d,type:f[a].markerType?f[a].markerType:this.markerType,size:f[a].marker
Size?f[a].markerSize:this.markerSize,color:f[a].markerColor?f[a].markerColor:this.markerCo
lor?this.markerColor:f[a].color?f[a].color:this.color?this.color:this._colorSet[a%this._colorSe
t.length],borderColor:f[a].markerBorderColor?f[a].markerBorderColor:this.markerBorderCol
or?this.markerBorderColor:null,borderThickness:f[a].markerBorderThickness?f[a].markerBo
rderThickness:this.markerBorderThickness?this.markerBorderThickness:

null}};U(B,M);B.prototype.createExtraLabelsForLog=function(a){a=(a||0)+1;if(!(5<a)){var
c=this.logLabelValues[0]||this.intervalStartPosition;if(Math.log(this.range)/Math.log(c/this.vi
ewportMinimum)<this.noTicks-1){for(var b=B.getNiceNumber((c-
this.viewportMinimum)/Math.min(Math.max(2,this.noTicks-
this.logLabelValues.length),3),!0),d=Math.ceil(this.viewportMinimum/b)*b;d<c;d+=b)d<this
.viewportMinimum||this.logLabelValues.push(d);this.logLabelValues.sort(za);this.createExtr
aLabelsForLog(a)}}};B.prototype.createLabels=

function(){var
a,c,b=0,d=0,f,g=0,h=0,d=0,k=this.interval,l=0,m,n=0.6*this.chart.height,b=!1;if(this.dataSeri
es&&0<this.dataSeries.length)for(d=0;d<this.dataSeries.length;d++)"dateTime"===this.data
Series[d].xValueType&&(b=!0);if("axisX"===this.type&&b&&!this.logarithmic)for(this.int

171
Chatbot designing

ervalStartPosition=this.getLabelStartPoint(new
Date(this.viewportMinimum),this.intervalType,this.interval),f=Ia(new
Date(this.viewportMaximum),this.interval,this.intervalType),b=this.intervalStartPosition;b<f;
Ia(b,k,this.intervalType))a=

b.getTime(),a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value
:b,label:this.labels[b]?this.labels[b]:null}):"axisX"===this.type&&this.labels[a]?this.labels[a]
:Fa(b,this.valueFormatString,this.chart._cultureInfo),a=new
W(this.ctx,{x:0,y:0,maxWidth:g,backgroundColor:this.labelBackgroundColor,borderColor:th
is.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCorne
rRadius,maxHeight:h,angle:this.labelAngle,text:this.prefix+a+this.suffix,

horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeig
ht:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBasel
ine:"middle"}),this._labels.push({position:b.getTime(),textBlock:a,effectiveHeight:null});els
e{f=this.viewportMaximum;if(this.labels){a=Math.ceil(k);for(var
k=Math.ceil(this.intervalStartPosition),p=!1,b=k;b<this.viewportMaximum;b+=a)if(this.label
s[b])p=!0;else{p=!1;break}p&&(this.interval=a,this.intervalStartPosition=

k)}if(this.logarithmic&&!this.equidistantInterval){this.logLabelValues||(this.logLabelValues
=[],this.createExtraLabelsForLog());for(var
e=0;e<this.logLabelValues.length;e++)b=this.logLabelValues[e],b<this.viewportMinimum||(
a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:b,label:this.
labels[b]?this.labels[b]:null}):"axisX"===this.type&&this.labels[b]?this.labels[b]:ca(b,this.va
lueFormatString,this.chart._cultureInfo),a=new
W(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:h,

angle:this.labelAngle,text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundCo
lor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadi
us:this.labelCornerRadius,horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.l
abelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:thi
s.labelFontStyle,textBaseline:"middle",borderThickness:0}),this._labels.push({position:b,text
Block:a,effectiveHeight:null}))}for(b=this.intervalStartPosition;b<=

f;b=parseFloat((this.logarithmic&&this.equidistantInterval?b*Math.pow(this.logarithmBase,t
his.interval):b+this.interval).toFixed(14)))a=this.labelFormatter?this.labelFormatter({chart:th

172
Chatbot designing

is.chart,axis:this.options,value:b,label:this.labels[b]?this.labels[b]:null}):"axisX"===this.type
&&this.labels[b]?this.labels[b]:ca(b,this.valueFormatString,this.chart._cultureInfo),a=new
W(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:h,angle:this.labelAngle,text:this.prefix+a+this.su
ffix,horizontalAlign:"left",backgroundColor:this.labelBackgroundColor,

borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:
this.labelCornerRadius,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeig
ht:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBasel
ine:"middle"}),this._labels.push({position:b,textBlock:a,effectiveHeight:null})}if("bottom"=
==this._position||"top"===this._position)l=this.logarithmic&&!this.equidistantInterval&&2<
=this._labels.length?this.lineCoordinates.width*

Math.log(Math.min(this._labels[this._labels.length-
1].position/this._labels[this._labels.length-
2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoo
rdinates.width/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(thi
s.logarithmBase):Math.abs(this.range))*E[this.intervalType+"Duration"]*this.interval,g="un
defined"===typeof
this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.p
anEnabled||(h="undefined"===

typeof
this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize);else
if("left"===this._position||"right"===this._position)l=this.logarithmic&&!this.equidistantInte
rval&&2<=this._labels.length?this.lineCoordinates.height*Math.log(Math.min(this._labels[th
is._labels.length-1].position/this._labels[this._labels.length-
2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoo
rdinates.height/(this.logarithmic&&this.equidistantInterval?

Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*E[this.intervalType
+"Duration"]*this.interval,this.chart.panEnabled||(g="undefined"===typeof
this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),h="undefi
ned"===typeof
this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize;for(d
=0;d<this._labels.length;d++){a=this._labels[d].textBlock;a.maxWidth=g;a.maxHeight=h;var
r=a.measureText();m=r.height}f=[];p=k=0;if(this.labelAutoFit||

173
Chatbot designing

this.options.labelAutoFit)if(x(this.labelAngle)||(this.labelAngle=(this.labelAngle%360+360)
%360,90<this.labelAngle&&270>this.labelAngle?this.labelAngle-
=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-
=360)),"bottom"===this._position||"top"===this._position)if(g=0.9*l>>0,p=0,!this.chart.pan
Enabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;th
is.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=h;this.sessionV
ariables.labelAngle=

this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b<this._labels.length
;b++){a=this._labels[b].textBlock;for(var q,s=a.text.split("
"),d=0;d<s.length;d++)e=s[d],this.ctx.font=a.fontStyle+" "+a.fontWeight+" "+a.fontSize+"px
"+a.fontFamily,e=this.ctx.measureText(e),e.width>p&&(q=b,p=e.width)}b=0;for(b=this.inter
valStartPosition<this.viewportMinimum?1:0;b<this._labels.length;b++)if(a=this._labels[b].te
xtBlock,r=a.measureText(),b<this._labels.length-1&&(e=b+1,c=this._labels[e].textBlock,

c=c.measureText()),f.push(a.height),this.sessionVariables.labelMaxHeight=Math.max.apply(
Math,f),Math.cos(Math.PI/180*Math.abs(this.labelAngle)),Math.sin(Math.PI/180*Math.abs(t
his.labelAngle)),d=g*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(h-
a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)),x(this.options.labelAngle)&
&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle)if(this.sessionVariables.lab
elMaxHeight=0===this.labelAngle?h:Math.min((d-
g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/

Math.sin(Math.PI/180*Math.abs(this.labelAngle)),d),s=(n-
(m+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(-25)))/Math.sin(Math.PI/180*Math.abs(-
25)),!x(this.options.labelWrap))this.labelWrap?x(this.options.labelMaxWidth)?(this.sessionV
ariables.labelMaxWidth=Math.min(Math.max(g,p),s),this.sessionVariables.labelWrap=this.la
belWrap,r.width+c.width>>0>2*g&&(this.sessionVariables.labelAngle=-
25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=t
his.options.labelMaxWidth,

this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-
25:this.sessionVariables.labelAngle):x(this.options.labelMaxWidth)?(this.sessionVariables.la
belWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.label
MaxWidth=g,r.width+c.width>>0>2*g&&(this.sessionVariables.labelAngle=-
25,this.sessionVariables.labelMaxWidth=s)):(this.sessionVariables.labelAngle=this.sessionV

174
Chatbot designing

ariables.labelMaxWidth>g?-
25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=

this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.la
belWrap=this.labelWrap);else{if(x(this.options.labelWrap))if(!x(this.options.labelMaxWidth
))this.options.labelMaxWidth<g?(this.sessionVariables.labelMaxWidth=this.options.labelMa
xWidth,this.sessionVariables.labelMaxHeight=d):(this.sessionVariables.labelAngle=-
25,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.la
belMaxHeight=h);else if(!x(c))if(d=r.width+c.width>>0,e=this.labelFontSize,

p<g)d-2*g>k&&(k=d-
2*g,d>=2*g&&d<2.2*g?(this.sessionVariables.labelMaxWidth=g,x(this.options.labelFontSiz
e)&&12<e&&(e=Math.floor(12/13*e),a.measureText()),this.sessionVariables.labelFontSize=
x(this.options.labelFontSize)?e:this.options.labelFontSize,this.sessionVariables.labelAngle=t
his.labelAngle):d>=2.2*g&&d<2.8*g?(this.sessionVariables.labelAngle=-
25,this.sessionVariables.labelMaxWidth=s,this.sessionVariables.labelFontSize=e):d>=2.8*g
&&d<3.2*g?(this.sessionVariables.labelMaxWidth=Math.max(g,p),

this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12<this.labelFontSize&
&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVari
ables.labelFontSize=x(this.options.labelFontSize)?e:this.options.labelFontSize,this.sessionVa
riables.labelAngle=this.labelAngle):d>=3.2*g&&d<3.6*g?(this.sessionVariables.labelAngle
=-
25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=s,this.sessionV
ariables.labelFontSize=this.labelFontSize):d>3.6*g&&

d<5*g?(x(this.options.labelFontSize)&&12<e&&(e=Math.floor(12/13*e),a.measureText()),t
his.sessionVariables.labelFontSize=x(this.options.labelFontSize)?e:this.options.labelFontSize
,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-
25,this.sessionVariables.labelMaxWidth=s):d>5*g&&(this.sessionVariables.labelWrap=!0,th
is.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelFontSize=e,this.sessionVari
ables.labelMaxHeight=h,this.sessionVariables.labelAngle=this.labelAngle));else if(q===

b&&(0===q&&p+this._labels[q+1].textBlock.measureText().width-
2*g>k||q===this._labels.length-1&&p+this._labels[q-1].textBlock.measureText().width-
2*g>k||0<q&&q<this._labels.length-

175
Chatbot designing

1&&p+this._labels[q+1].textBlock.measureText().width-2*g>k&&p+this._labels[q-
1].textBlock.measureText().width-
2*g>k))k=0===q?p+this._labels[q+1].textBlock.measureText().width-2*g:p+this._labels[q-
1].textBlock.measureText().width-
2*g,this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?e:this.options.labelFon
tSize,

this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-
25,this.sessionVariables.labelMaxWidth=s;else
if(0===k)for(this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?e:this.options
.labelFontSize,this.sessionVariables.labelWrap=!0,d=0;d<this._labels.length;d++)a=this._lab
els[d].textBlock,a.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(g,p
),s),r=a.measureText(),d<this._labels.length-
1&&(e=d+1,c=this._labels[e].textBlock,c.maxWidth=this.sessionVariables.labelMaxWidth=

Math.min(Math.max(g,p),s),c=c.measureText(),r.width+c.width>>0>2*g&&(this.sessionVari
ables.labelAngle=-
25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHe
ight=0===this.labelAngle?h:Math.min((d-
g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.l
abelAngle)),d),s=0!=this.labelAngle?(n-
(m+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180
*Math.abs(this.labelAngle)):g,this.sessionVariables.labelMaxHeight=

h=this.labelWrap?(n-
s*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.l
abelAngle)):1.5*this.labelFontSize,x(this.options.labelWrap))?x(this.options.labelWrap)&&(
this.labelWrap&&!x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.lab
elWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.label
MaxWidth:s,this.sessionVariables.labelMaxHeight=h):(this.sessionVariables.labelAngle=this
.labelAngle,this.sessionVariables.labelMaxWidth=

s,this.sessionVariables.labelMaxHeight=d<0.9*l?0.9*l:d,this.sessionVariables.labelWrap=thi
s.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.s
essionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:s):
(x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMax

176
Chatbot designing

Width?this.options.labelMaxWidth:s,this.sessionVariables.labelWrap=this.labelWrap),this.se
ssionVariables.labelMaxHeight=h);for(d=0;d<this._labels.length;d++)a=

this._labels[d].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxW
idth,a.fontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=this.sessionVari
ables.labelAngle,a.wrap=this.labelWrap=this.sessionVariables.labelWrap,a.maxHeight=this.s
essionVariables.labelMaxHeight,a.measureText()}else
for(b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWi
dth=x(this.options.labelMaxWidth)?this.sessionVariables.labelMaxWidth:this.options.labelM
axWidth,

a.fontSize=this.labelFontSize=x(this.options.labelFontSize)?this.sessionVariables.labelFontS
ize:this.options.labelFontSize,a.angle=this.labelAngle=x(this.options.labelAngle)?this.sessio
nVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=x(this.options.labelWrap)?this
.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=this.sessionVariables.label
MaxHeight,a.measureText();else
if("left"===this._position||"right"===this._position)if(g=x(this.options.labelMaxWidth)?0.3*t
his.chart.width>>

0:this.options.labelMaxWidth,h="undefined"===typeof
this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize,!this.c
hart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFo
ntSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=h;this.
sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.lab
elAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b<this._labels.length;b++)(
a=

this._labels[b].textBlock,r=a.measureText(),b<this._labels.length-
1&&(e=b+1,c=this._labels[e].textBlock,c=c.measureText()),f.push(a.height),this.sessionVari
ables.labelMaxHeight=Math.max.apply(Math,f),d=g*Math.sin(Math.PI/180*Math.abs(this.la
belAngle))+(h-
a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)),Math.cos(Math.PI/180*Mat
h.abs(this.labelAngle)),Math.sin(Math.PI/180*Math.abs(this.labelAngle)),x(this.options.label
Angle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle)?

177
Chatbot designing

x(this.options.labelWrap)?x(this.options.labelWrap)&&(x(this.options.labelMaxWidth)?x(c)||
(l=r.height+c.height>>0,l-2*h>p&&(p=l-
2*h,l>=2*h&&l<2.4*h?(x(this.options.labelFontSize)&&12<this.labelFontSize&&(this.label
FontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.label
MaxHeight=h,this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?this.labelFo
ntSize:this.options.labelFontSize):l>=2.4*h&&l<2.8*h?(this.sessionVariables.labelMaxHeig
ht=d,this.sessionVariables.labelFontSize=

this.labelFontSize,this.sessionVariables.labelWrap=!0):l>=2.8*h&&l<3.2*h?(this.sessionVar
iables.labelMaxHeight=h,this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&
&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.meas
ureText()),this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?this.labelFontSi
ze:this.options.labelFontSize,this.sessionVariables.labelAngle=x(this.sessionVariables.labelA
ngle)?0:this.sessionVariables.labelAngle):l>=3.2*h&&

l<3.6*h?(this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelWrap=!0,this.se
ssionVariables.labelFontSize=this.labelFontSize):l>3.6*h&&l<10*h?(x(this.options.labelFon
tSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),
a.measureText()),this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?this.label
FontSize:this.options.labelFontSize,this.sessionVariables.labelMaxWidth=g,this.sessionVaria
bles.labelMaxHeight=h,this.sessionVariables.labelAngle=

x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):l>10*h&&l<50*h&
&(x(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(
12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=x(this.option
s.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMax
Height=h,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelAngle=x(this.se
ssionVariables.labelAngle)?0:this.sessionVariables.labelAngle))):

(this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelMaxWidth=this.options.l
abelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth)):(this.sess
ionVariables.labelMaxWidth=this.labelWrap?this.options.labelMaxWidth?this.options.label
MaxWidth:this.sessionVariables.labelMaxWidth:this.labelMaxWidth?this.options.labelMax
Width?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth:g,this.sessionVaria
bles.labelMaxHeight=h):(this.sessionVariables.labelAngle=this.labelAngle,

178
Chatbot designing

this.sessionVariables.labelMaxWidth=0===this.labelAngle?g:Math.min((d-
h*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.l
abelAngle)),h),x(this.options.labelWrap))?x(this.options.labelWrap)&&(this.labelWrap&&!x
(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=this.options.labelMax
Width?this.options.labelMaxWidth>this.options.labelMaxWidth:this.sessionVariables.label
MaxWidth,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxH
eight=

d):(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMax
Width:g,this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:d,x(this.options.label
MaxWidth)&&(this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(
this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:d,this.sessionVariables.labelW
rap=this.labelWrap,this.sessionVariables.labelMaxWidth=g):(this.sessionVariables.labelMax
Height=h,x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=

this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidt
h,this.sessionVariables.labelWrap=this.labelWrap);for(d=0;d<this._labels.length;d++)a=this.
_labels[d].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxWidth,
a.fontSize=this.labelFontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=t
his.sessionVariables.labelAngle,a.wrap=this.labelWrap=this.sessionVariables.labelWrap,a.m
axHeight=this.sessionVariables.labelMaxHeight,a.measureText()}else for(b=

0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=x(t
his.options.labelMaxWidth)?this.sessionVariables.labelMaxWidth:this.options.labelMaxWidt
h,a.fontSize=this.labelFontSize=x(this.options.labelFontSize)?this.sessionVariables.labelFont
Size:this.options.labelFontSize,a.angle=this.labelAngle=x(this.options.labelAngle)?this.sessi
onVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=x(this.options.labelWrap)?thi
s.sessionVariables.labelWrap:this.options.labelWrap,

a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText();for(b=0;b<this.stripLin
es.length;b++){var
g=this.stripLines[b],u;if("outside"===g.labelPlacement){h=this.sessionVariables.labelMaxW
idth;if("bottom"===this._position||"top"===this._position)u="undefined"===typeof
g.options.labelWrap?this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.height
>>0:1.5*this.labelFontSize;if("left"===this._position||"right"===this._position)u="undefined
"===typeof g.options.labelWrap?this.sessionVariables.labelMaxHeight:

179
Chatbot designing

g.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;c=x(g.options.labelBackground
Color)?"#EEEEEE":g.options.labelBackgroundColor}else
h="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.
height>>0,u="undefined"===typeof
g.options.labelWrap||g.labelWrap?"bottom"===this._position||"top"===this._position?0.8*thi
s.chart.width>>0:0.8*this.chart.height>>0:1.5*this.labelFontSize,c=x(g.options.labelBackgro
undColor)?x(g.startValue)&&0!==g.startValue?v?"transparent":

null:"#EEEEEE":g.options.labelBackgroundColor;a=new
W(this.ctx,{x:0,y:0,backgroundColor:c,borderColor:g.labelBorderColor,borderThickness:g.la
belBorderThickness,cornerRadius:g.labelCornerRadius,maxWidth:g.options.labelMaxWidth?
g.options.labelMaxWidth:h,maxHeight:u,angle:this.labelAngle,text:g.labelFormatter?g.labelF
ormatter({chart:this.chart,axis:this,stripLine:g}):g.label,horizontalAlign:"left",fontSize:"outsi
de"===g.labelPlacement?g.options.labelFontSize?g.options.labelFontSize:this.labelFontSize:

g.labelFontSize,fontFamily:"outside"===g.labelPlacement?g.options.labelFontFamily?g.opti
ons.labelFontFamily:this.labelFontFamily:g.labelFontFamily,fontWeight:"outside"===g.labe
lPlacement?g.options.fontWeight?g.options.fontWeight:this.fontWeight:g.fontWeight,fontCo
lor:g.options.labelFontColor||g.color,fontStyle:"outside"===g.labelPlacement?g.options.fontS
tyle?g.options.fontStyle:this.fontWeight:g.fontStyle,textBaseline:"middle"});this._stripLineL
abels.push({position:g.value,textBlock:a,effectiveHeight:null,

stripLine:g})}};B.prototype.createLabelsAndCalculateWidth=function(){var
a=0,c=0;this._labels=[];this._stripLineLabels=[];if("left"===this._position||"right"===this._p
osition){this.createLabels();for(c=0;c<this._labels.length;c++){var
b=this._labels[c].textBlock,d=b.measureText(),f=0,f=0===this.labelAngle?d.width:d.width*
Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(d.height-
b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle));a<f&&(a=f);this._labels[c].
effectiveWidth=f}for(c=0;c<this._stripLineLabels.length;c++)"outside"===

this._stripLineLabels[c].stripLine.labelPlacement&&(this._stripLineLabels[c].stripLine.value
>this.viewportMinimum&&this._stripLineLabels[c].stripLine.value<this.viewportMaximum)
&&(b=this._stripLineLabels[c].textBlock,d=b.measureText(),f=0===this.labelAngle?d.width
:d.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(d.height-
b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle)),a<f&&(a=f),this._stripLine
Labels[c].effectiveWidth=f)}return(this.title?this._titleTextBlock.measureText().height+

180
Chatbot designing

2:0)+a+this.tickLength+5};B.prototype.createLabelsAndCalculateHeight=function(){var
a=0;this._labels=[];this._stripLineLabels=[];var
c,b=0;this.createLabels();if("bottom"===this._position||"top"===this._position){for(b=0;b<th
is._labels.length;b++){c=this._labels[b].textBlock;var
d=c.measureText(),f=0,f=0===this.labelAngle?d.height:d.width*Math.sin(Math.PI/180*Mat
h.abs(this.labelAngle))+(d.height-
c.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));a<f&&(a=f);this._labels[b].
effectiveHeight=

f}for(b=0;b<this._stripLineLabels.length;b++)"outside"===this._stripLineLabels[b].stripLine
.labelPlacement&&(c=this._stripLineLabels[b].textBlock,d=c.measureText(),f=0===this.labe
lAngle?d.height:d.width*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(d.height-
c.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)),a<f&&(a=f),this._stripLine
Labels[b].effectiveHeight=f)}return(this.title?this._titleTextBlock.measureText().height+2:0)
+a+this.tickLength+5};B.setLayoutAndRender=function(a,c,b,d,

f,g){var h,k,l,m,n=a[0]?a[0].chart:c[0].chart,p=n.ctx;if(a&&0<a.length)for(var
e=0;e<a.length;e++)a[e]&&a[e].calculateAxisParameters();if(c&&0<c.length)for(e=0;e<c.le
ngth;e++)c[e].calculateAxisParameters();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].calc
ulateAxisParameters();if(d&&0<d.length)for(e=0;e<d.length;e++)d[e].calculateAxisParamet
ers();var
r=0,q=0,s=0,u=0,w=0,v=0,t=0,z,A,B=k=0,E,F,G,J;E=F=G=J=!1;if(a&&0<a.length)for(e=0;e
<a.length;e++)a[e]&&a[e].title&&(a[e]._titleTextBlock=new W(a[e].ctx,

{text:a[e].title,horizontalAlign:"center",fontSize:a[e].titleFontSize,fontFamily:a[e].titleFontF
amily,fontWeight:a[e].titleFontWeight,fontColor:a[e].titleFontColor,fontStyle:a[e].titleFontSt
yle,borderColor:a[e].titleBorderColor,borderThickness:a[e].titleBorderThickness,background
Color:a[e].titleBackgroundColor,cornerRadius:a[e].titleCornerRadius,textBaseline:"top"}));if
(c&&0<c.length)for(e=0;e<c.length;e++)c[e]&&c[e].title&&(c[e]._titleTextBlock=new
W(c[e].ctx,{text:c[e].title,horizontalAlign:"center",

fontSize:c[e].titleFontSize,fontFamily:c[e].titleFontFamily,fontWeight:c[e].titleFontWeight,f
ontColor:c[e].titleFontColor,fontStyle:c[e].titleFontStyle,borderColor:c[e].titleBorderColor,b
orderThickness:c[e].titleBorderThickness,backgroundColor:c[e].titleBackgroundColor,corner
Radius:c[e].titleCornerRadius,textBaseline:"top"}));if(b&&0<b.length)for(e=0;e<b.length;e+
+)b[e]&&b[e].title&&(b[e]._titleTextBlock=new

181
Chatbot designing

W(b[e].ctx,{text:b[e].title,horizontalAlign:"center",fontSize:b[e].titleFontSize,fontFamily:b[e
].titleFontFamily,

fontWeight:b[e].titleFontWeight,fontColor:b[e].titleFontColor,fontStyle:b[e].titleFontStyle,b
orderColor:b[e].titleBorderColor,borderThickness:b[e].titleBorderThickness,backgroundColo
r:b[e].titleBackgroundColor,cornerRadius:b[e].titleCornerRadius,textBaseline:"top"}));if(d&
&0<d.length)for(e=0;e<d.length;e++)d[e]&&d[e].title&&(d[e]._titleTextBlock=new
W(d[e].ctx,{text:d[e].title,horizontalAlign:"center",fontSize:d[e].titleFontSize,fontFamily:d[e
].titleFontFamily,fontWeight:d[e].titleFontWeight,fontColor:d[e].titleFontColor,

fontStyle:d[e].titleFontStyle,borderColor:d[e].titleBorderColor,borderThickness:d[e].titleBor
derThickness,backgroundColor:d[e].titleBackgroundColor,cornerRadius:d[e].titleCornerRadi
us,textBaseline:"top"}));if("normal"===f){var
u=[],w=[],v=[],t=[],H=[],I=[],M=[],K=[];if(a&&0<a.length)for(e=0;e<a.length;e++)a[e]&&a
[e].title&&(a[e]._titleTextBlock.maxWidth=a[e].titleMaxWidth||g.width,a[e]._titleTextBlock
.maxHeight=a[e].titleWrap?0.8*g.height:1.5*a[e].titleFontSize,a[e]._titleTextBlock.angle=0)
;if(c&&

0<c.length)for(e=0;e<c[e].length;e++)c[e]&&c[e].title&&(c[e]._titleTextBlock.maxWidth=c
[e].titleMaxWidth||g.width,c[e]._titleTextBlock.maxHeight=c[e].titleWrap?0.8*g.height:1.5*
c[e].titleFontSize,c[e]._titleTextBlock.angle=0);if(b&&0<b.length)for(e=0;e<b.length;e++)b[
e]&&b[e].title&&(b[e]._titleTextBlock.maxWidth=b[e].titleMaxWidth||g.height,b[e]._titleTe
xtBlock.maxHeight=b[e].titleWrap?0.8*g.width:1.5*b[e].titleFontSize,b[e]._titleTextBlock.a
ngle=-90);if(d&&0<d.length)for(e=0;e<d.length;e++)d[e]&&

d[e].title&&(d[e]._titleTextBlock.maxWidth=d[e].titleMaxWidth||g.height,d[e]._titleTextBlo
ck.maxHeight=d[e].titleWrap?0.8*g.width:1.5*d[e].titleFontSize,d[e]._titleTextBlock.angle=
90);for(;4>r;){var
N=0,Q=0,P=0,O=0,L=f=0,C=0,S=0,X=0,V=0,U=0,T=0;if(b&&0<b.length)for(v=[],e=U=0;e
<b.length;e++)v.push(Math.ceil(b[e]?b[e].createLabelsAndCalculateWidth():0)),U+=v[e],C+
=b[e]?b[e].margin:0;else
v.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateWidth():0));M.push(v);if(d&&0<d.leng
th)for(t=[],e=T=0;e<d.length;e++)t.push(Math.ceil(d[e]?

d[e].createLabelsAndCalculateWidth():0)),T+=t[e],S+=d[e]?d[e].margin:0;else
t.push(Math.ceil(d[0]?d[0].createLabelsAndCalculateWidth():0));K.push(t);h=Math.round(g.

182
Chatbot designing

x1+U+C);l=Math.round(g.x2-T-S>n.width-10?n.width-10:g.x2-T-
S);if(a&&0<a.length)for(u=[],e=X=0;e<a.length;e++)a[e]&&(a[e].lineCoordinates={}),a[e].l
ineCoordinates.width=Math.abs(l-
h),a[e].title&&(a[e]._titleTextBlock.maxWidth=0<a[e].titleMaxWidth&&a[e].titleMaxWidth
<a[e].lineCoordinates.width?a[e].titleMaxWidth:a[e].lineCoordinates.width),

u.push(Math.ceil(a[e]?a[e].createLabelsAndCalculateHeight():0)),X+=u[e],f+=a[e]?a[e].marg
in:0;else
u.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateHeight():0));H.push(u);if(c&&0<c.leng
th)for(w=[],e=V=0;e<c.length;e++)c[e]&&(c[e].lineCoordinates={}),c[e].lineCoordinates.wi
dth=Math.abs(l-
h),c[e].title&&(c[e]._titleTextBlock.maxWidth=0<c[e].titleMaxWidth&&c[e].titleMaxWidth
<c[e].lineCoordinates.width?c[e].titleMaxWidth:c[e].lineCoordinates.width),w.push(Math.cei
l(c[e]?c[e].createLabelsAndCalculateHeight():

0)),V+=w[e],L+=c[e]?c[e].margin:0;else
w.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateHeight():0));I.push(w);if(a&&0<a.leng
th)for(e=0;e<a.length;e++)a[e]&&(a[e].lineCoordinates.x1=h,a[e].lineCoordinates.x2=Math.r
ound(g.x2-T-S>n.width-10?n.width-10:g.x2-T-
S),a[e]._labels&&1<a[e]._labels.length&&(k=m=0,m=a[e]._labels[1],k="dateTime"===a[e].
chart.plotInfo.axisXValueType?a[e]._labels[a[e]._labels.length-
2]:a[e]._labels[a[e]._labels.length-
1],q=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+

(m.textBlock.height-
k.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),s=k.textBlock.
width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-
k.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle))),a[e]&&(a[e].la
belAutoFit&&!x(z)&&!x(A))&&(k=0,0<a[e].labelAngle?A+s>l&&(k+=0<a[e].labelAngle?
A+s-l-T:0):0>a[e].labelAngle?z-q<h&&z-q<a[e].viewportMinimum&&(B=h-
(C+a[e].tickLength+v+z-q+a[e].labelFontSize/2)):0===a[e].labelAngle&&(A+s>l&&(k=A+

s/2-l-T),z-q<h&&z-q<a[e].viewportMinimum&&(B=h-C-a[e].tickLength-v-
z+q/2)),a[e].viewportMaximum===a[e].maximum&&a[e].viewportMinimum===a[e].minim
um&&0<a[e].labelAngle&&0<k?l-
=k:a[e].viewportMaximum===a[e].maximum&&a[e].viewportMinimum===a[e].minimum&

183
Chatbot designing

&0>a[e].labelAngle&&0<B?h+=B:a[e].viewportMaximum===a[e].maximum&&a[e].viewp
ortMinimum===a[e].minimum&&0===a[e].labelAngle&&(0<B&&(h+=B),0<k&&(l-
=k))),n.panEnabled?X=n.sessionVariables.axisX.height:n.sessionVariables.axisX.height=X,k
=Math.round(g.y2-X-

f+N),m=Math.round(g.y2),a[e].lineCoordinates.x2=l,a[e].lineCoordinates.width=l-
h,a[e].lineCoordinates.y1=k,a[e].lineCoordinates.y2=k,a[e].bounds={x1:h,y1:k,x2:l,y2:m-
(X+f-u[e]-N),width:l-h,height:m-
k}),N+=u[e]+a[e].margin;if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].lineCoordinates.x1
=Math.round(g.x1+U+C),c[e].lineCoordinates.x2=Math.round(g.x2-T-S>n.width-
10?n.width-10:g.x2-T-S),c[e].lineCoordinates.width=Math.abs(l-
h),c[e]._labels&&1<c[e]._labels.length&&(m=c[e]._labels[1],k="dateTime"===c[e].chart.pl
otInfo.axisXValueType?

c[e]._labels[c[e]._labels.length-2]:c[e]._labels[c[e]._labels.length-
1],q=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock
.height-
k.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),s=k.textBlock.
width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-
k.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle))),n.panEnabled?
V=n.sessionVariables.axisX2.height:n.sessionVariables.axisX2.height=V,k=Math.round(g.y1
),

m=Math.round(g.y2+c[e].margin),c[e].lineCoordinates.y1=k+V+L-
Q,c[e].lineCoordinates.y2=k,c[e].bounds={x1:h,y1:k+(V+L-w[e]-Q),x2:l,y2:m,width:l-
h,height:m-
k},Q+=w[e]+c[e].margin;if(b&&0<b.length)for(e=0;e<b.length;e++)C=10,b[e]&&(h=Math.r
ound(a[0]?a[0].lineCoordinates.x1:c[0].lineCoordinates.x1),C=b[e]._labels&&0<b[e]._labels
.length?b[e]._labels[b[e]._labels.length-
1].textBlock.height/2:10,k=Math.round(g.y1+V+L<Math.max(C,10)?Math.max(C,10):g.y1+
V+L),l=Math.round(a[0]?a[0].lineCoordinates.x1:c[0].lineCoordinates.x1),

C=0<a.length?0:b[e]._labels[0].textBlock.height/2,m=Math.round(g.y2-X-f-
C),b[e].lineCoordinates={x1:l-P,y1:k,x2:l-P,y2:m,height:Math.abs(m-k)},b[e].bounds={x1:h-
(v[e]+P),y1:k,x2:l,y2:m,width:l-h,height:m-
k},b[e].title&&(b[e]._titleTextBlock.maxWidth=0<b[e].titleMaxWidth&&b[e].titleMaxWidt

184
Chatbot designing

h<b[e].lineCoordinates.height?b[e].titleMaxWidth:b[e].lineCoordinates.height),P+=v[e]+b[e]
.margin);if(d&&0<d.length)for(e=0;e<d.length;e++)d[e]&&(h=Math.round(a[0]?a[0].lineCo
ordinates.x2:c[0].lineCoordinates.x2),

l=Math.round(h),C=d[e]._labels&&0<d[e]._labels.length?d[e]._labels[d[e]._labels.length-
1].textBlock.height/2:0,k=Math.round(g.y1+V+L<Math.max(C,10)?Math.max(C,10):g.y1+V
+L),C=0<a.length?0:d[e]._labels[0].textBlock.height/2,m=Math.round(g.y2-
(X+f+C)),d[e].lineCoordinates={x1:h+O,y1:k,x2:h+O,y2:m,height:Math.abs(m-
k)},d[e].bounds={x1:h,y1:k,x2:l+(t[e]+O),y2:m,width:l-h,height:m-
k},d[e].title&&(d[e]._titleTextBlock.maxWidth=0<d[e].titleMaxWidth&&d[e].titleMaxWidt
h<d[e].lineCoordinates.height?d[e].titleMaxWidth:

d[e].lineCoordinates.height),O+=t[e]+d[e].margin);if(a&&0<a.length)for(e=0;e<a.length;e++
)a[e]&&(a[e].calculateValueToPixelConversionParameters(),a[e]._labels&&1<a[e]._labels.le
ngth&&(z=(a[e].logarithmic?Math.log(a[e]._labels[1].position/a[e].viewportMinimum)/a[e].c
onversionParameters.lnLogarithmBase:a[e]._labels[1].position-
a[e].viewportMinimum)*Math.abs(a[e].conversionParameters.pixelPerUnit)+a[e].lineCoordi
nates.x1,A="dateTime"===a[e].chart.plotInfo.axisXValueType?(a[e].logarithmic?Math.log(a
[e]._labels[a[e]._labels.length-

2].position/a[e].viewportMinimum)/a[e].conversionParameters.lnLogarithmBase:a[e]._labels
[a[e]._labels.length-2].position-
a[e].viewportMinimum)*Math.abs(a[e].conversionParameters.pixelPerUnit)+a[e].lineCoordi
nates.x1:(a[e].logarithmic?Math.log(a[e]._labels[a[e]._labels.length-
1].position/a[e].viewportMinimum)/a[e].conversionParameters.lnLogarithmBase:a[e]._labels
[a[e]._labels.length-1].position-
a[e].viewportMinimum)*Math.abs(a[e].conversionParameters.pixelPerUnit)+a[e].lineCoordi
nates.x1));if(c&&0<

c.length)for(e=0;e<c.length;e++)c[e].calculateValueToPixelConversionParameters(),c[e]._lab
els&&1<c[e]._labels.length&&(z=(c[e].logarithmic?Math.log(c[e]._labels[1].position/c[e].vi
ewportMinimum)/c[e].conversionParameters.lnLogarithmBase:c[e]._labels[1].position-
c[e].viewportMinimum)*Math.abs(c[e].conversionParameters.pixelPerUnit)+c[e].lineCoordi
nates.x1,A="dateTime"===c[e].chart.plotInfo.axisXValueType?(c[e].logarithmic?Math.log(c
[e]._labels[c[e]._labels.length-2].position/c[e].viewportMinimum)/

185
Chatbot designing

c[e].conversionParameters.lnLogarithmBase:c[e]._labels[c[e]._labels.length-2].position-
c[e].viewportMinimum)*Math.abs(c[e].conversionParameters.pixelPerUnit)+c[e].lineCoordi
nates.x1:(c[e].logarithmic?Math.log(c[e]._labels[c[e]._labels.length-
1].position/c[e].viewportMinimum)/c[e].conversionParameters.lnLogarithmBase:c[e]._labels
[c[e]._labels.length-1].position-
c[e].viewportMinimum)*Math.abs(c[e].conversionParameters.pixelPerUnit)+c[e].lineCoordi
nates.x1);if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].calculateValueToPixelConversionP
arameters();

if(d&&0<d.length)for(e=0;e<d.length;e++)d[e].calculateValueToPixelConversionParameters
();if(0<r){if(a&&0<a.length)for(e=0;e<a.length;e++)E=H[r-1][e]===H[r][e]?!0:!1;else
E=!0;if(c&&0<c.length)for(e=0;e<c.length;e++)F=I[r-1][e]===I[r][e]?!0:!1;else
F=!0;if(b&&0<b.length)for(e=0;e<b.length;e++)G=M[r-1][e]===M[r][e]?!0:!1;else
G=!0;if(d&&0<d.length)for(e=0;e<d.length;e++)J=K[r-1][e]===K[r][e]?!0:!1;else
J=!0}if(E&&F&&G&&J)break;r++}p.save();p.beginPath();a[0]&&p.rect(5,a[0].bounds.y1,a
[0].chart.width-

10,a[0].bounds.height);c[0]&&p.rect(5,c[c.length-1].bounds.y1,c[0].chart.width-
10,c[0].bounds.height);p.clip();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].renderLabelsT
icksAndTitle();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderLabelsTicksAndTitle();
p.restore();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderLabelsTicksAndTitle();if(d
&&0<d.length)for(e=0;e<d.length;e++)d[e].renderLabelsTicksAndTitle()}else{z=[];A=[];B=
[];q=[];s=[];H=[];I=[];M=[];if(a&&0<a.length)for(e=0;e<a.length;e++)a[e]&&

a[e].title&&(a[e]._titleTextBlock.maxWidth=a[e].titleMaxWidth||g.width,a[e]._titleTextBloc
k.maxHeight=a[e].titleWrap?0.8*g.height:1.5*a[e].titleFontSize,a[e]._titleTextBlock.angle=-
90);if(c&&0<c.length)for(e=0;e<c.length;e++)c[e]&&c[e].title&&(c[e]._titleTextBlock.max
Width=c[e].titleMaxWidth||g.width,c[e]._titleTextBlock.maxHeight=c[e].titleWrap?0.8*g.hei
ght:1.5*c[e].titleFontSize,c[e]._titleTextBlock.angle=90);if(b&&0<b.length)for(e=0;e<b.leng
th;e++)b[e]&&b[e].title&&(b[e]._titleTextBlock.maxWidth=

b[e].titleMaxWidth||g.width,b[e]._titleTextBlock.maxHeight=b[e].titleWrap?0.8*g.height:1.5
*b[e].titleFontSize,b[e]._titleTextBlock.angle=0);if(d&&0<d.length)for(e=0;e<d.length;e++)
d[e]&&d[e].title&&(d[e]._titleTextBlock.maxWidth=d[e].titleMaxWidth||g.width,d[e]._titleT
extBlock.maxHeight=d[e].titleWrap?0.8*g.height:1.5*d[e].titleFontSize,d[e]._titleTextBlock.

186
Chatbot designing

angle=0);for(;4>r;){V=X=U=O=S=C=L=f=P=K=Q=N=0;if(a&&0<a.length)for(B=[],e=X=0
;e<a.length;e++)B.push(Math.ceil(a[e]?a[e].createLabelsAndCalculateWidth():

0)),X+=B[e],f+=a[e]?a[e].margin:0;else
B.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateWidth():0));I.push(B);if(c&&0<c.lengt
h)for(q=[],e=V=0;e<c.length;e++)q.push(Math.ceil(c[e]?c[e].createLabelsAndCalculateWidt
h():0)),V+=q[e],L+=c[e]?c[e].margin:0;else
q.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateWidth():0));M.push(q);if(b&&0<b.leng
th)for(e=0;e<b.length;e++)b[e].lineCoordinates={},h=Math.round(g.x1+X+f),l=Math.round(
g.x2-V-L>n.width-10?n.width-10:g.x2-V-L),b[e].labelAutoFit&&!x(u)&&(0<!a.length&&

(h=0>b[e].labelAngle?Math.max(h,u):0===b[e].labelAngle?Math.max(h,u/2):h),0<!c.length
&&(l=0<b[e].labelAngle?l-w/2:0===b[e].labelAngle?l-
w/2:l)),b[e].lineCoordinates.x1=h,b[e].lineCoordinates.x2=l,b[e].lineCoordinates.width=Mat
h.abs(l-
h),b[e].title&&(b[e]._titleTextBlock.maxWidth=0<b[e].titleMaxWidth&&b[e].titleMaxWidt
h<b[e].lineCoordinates.width?b[e].titleMaxWidth:b[e].lineCoordinates.width);if(d&&0<d.le
ngth)for(e=0;e<d.length;e++)d[e].lineCoordinates={},h=Math.round(g.x1+X+f),l=Math.roun
d(g.x2-V-

L>d[e].chart.width-10?d[e].chart.width-10:g.x2-V-
L),d[e]&&d[e].labelAutoFit&&!x(v)&&(0<!a.length&&(h=0<d[e].labelAngle?Math.max(h,
v):0===d[e].labelAngle?Math.max(h,v/2):h),0<!c.length&&(l-
=t/2)),d[e].lineCoordinates.x1=h,d[e].lineCoordinates.x2=l,d[e].lineCoordinates.width=Math.
abs(l-
h),d[e].title&&(d[e]._titleTextBlock.maxWidth=0<d[e].titleMaxWidth&&d[e].titleMaxWidt
h<d[e].lineCoordinates.width?d[e].titleMaxWidth:d[e].lineCoordinates.width);if(b&&0<b.le
ngth)for(z=[],e=O=0;e<b.length;e++)z.push(Math.ceil(b[e]?

b[e].createLabelsAndCalculateHeight():0)),O+=z[e]+b[e].margin,C+=b[e].margin;else
z.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateHeight():0));s.push(z);if(d&&0<d.lengt
h)for(A=[],e=U=0;e<d.length;e++)A.push(Math.ceil(d[e]?d[e].createLabelsAndCalculateHei
ght():0)),U+=A[e],S+=d[e].margin;else
A.push(Math.ceil(d[0]?d[0].createLabelsAndCalculateHeight():0));H.push(A);if(b&&0<b.len
gth)for(e=0;e<b.length;e++)0<b[e]._labels.length&&(m=b[e]._labels[0],k=b[e]._labels[b[e].
_labels.length-1],u=m.textBlock.width*

187
Chatbot designing

Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-
k.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),w=k.textBlock
.width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-
k.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle)));if(d&&0<d.le
ngth)for(e=0;e<d.length;e++)d[e]&&0<d[e]._labels.length&&(m=d[e]._labels[0],k=d[e]._lab
els[d[e]._labels.length-
1],v=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+

(m.textBlock.height-
k.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),t=k.textBlock.
width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-
k.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle)));if(n.panEnable
d)for(e=0;e<b.length;e++)z[e]=n.sessionVariables.axisY.height;else
for(e=0;e<b.length;e++)n.sessionVariables.axisY.height=z[e];if(b&&0<b.length)for(e=b.leng
th-1;0<=e;e--)k=Math.round(g.y2),m=Math.round(g.y2>b[e].chart.height-10?

b[e].chart.height-10:g.y2),b[e].lineCoordinates.y1=k-
(z[e]+b[e].margin+N),b[e].lineCoordinates.y2=k-
(z[e]+b[e].margin+N),b[e].bounds={x1:h,y1:k-(z[e]+N+b[e].margin),x2:l,y2:m-
(N+b[e].margin),width:l-
h,height:z[e]},b[e].title&&(b[e]._titleTextBlock.maxWidth=0<b[e].titleMaxWidth&&b[e].tit
leMaxWidth<b[e].lineCoordinates.width?b[e].titleMaxWidth:b[e].lineCoordinates.width),N+
=z[e]+b[e].margin;if(d&&0<d.length)for(e=d.length-1;0<=e;e--
)d[e]&&(k=Math.round(g.y1),m=Math.round(g.y1+(A[e]+d[e].margin+Q)),

d[e].lineCoordinates.y1=m,d[e].lineCoordinates.y2=m,d[e].bounds={x1:h,y1:k+(d[e].margin
+Q),x2:l,y2:m,width:l-
h,height:U},d[e].title&&(d[e]._titleTextBlock.maxWidth=0<d[e].titleMaxWidth&&d[e].title
MaxWidth<d[e].lineCoordinates.width?d[e].titleMaxWidth:d[e].lineCoordinates.width),Q+=
A[e]+d[e].margin);if(a&&0<a.length)for(e=0;e<a.length;e++){C=a[e]._labels&&0<a[e]._lab
els.length?a[e]._labels[0].textBlock.fontSize/2:0;h=Math.round(g.x1+f);k=d&&0<d.length?
Math.round(d[0]?d[0].lineCoordinates.y2:g.y1<Math.max(C,

10)?Math.max(C,10):g.y1):g.y1<Math.max(C,10)?Math.max(C,10):g.y1;l=Math.round(g.x1
+X+f);m=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:g.y2-O>n.height-
Math.max(C,10)?n.height-Math.max(C,10):g.y2-O):g.y2>n.height-

188
Chatbot designing

Math.max(C,10)?n.height-
Math.max(C,10):g.y2;if(b&&0<b.length)for(C=0;C<b.length;C++)b[C]&&b[C].labelAutoFit
&&(l=0>b[C].labelAngle?Math.max(l,u):0===b[C].labelAngle?Math.max(l,u/2):l,h=0>b[C].
labelAngle||0===b[C].labelAngle?l-
X:h);if(d&&0<d.length)for(C=0;C<d.length;C++)d[C]&&d[C].labelAutoFit&&

(l=d[C].lineCoordinates.x1,h=l-X);a[e].lineCoordinates={x1:l-K,y1:k,x2:l-
K,y2:m,height:Math.abs(m-k)};a[e].bounds={x1:l-(B[e]+K),y1:k,x2:l,y2:m,width:l-
h,height:m-
k};a[e].title&&(a[e]._titleTextBlock.maxWidth=0<a[e].titleMaxWidth&&a[e].titleMaxWidt
h<a[e].lineCoordinates.height?a[e].titleMaxWidth:a[e].lineCoordinates.height);a[e].calculate
ValueToPixelConversionParameters();K+=B[e]+a[e].margin}if(c&&0<c.length)for(e=0;e<c.
length;e++){C=c[e]._labels&&0<c[e]._labels.length?c[e]._labels[0].textBlock.fontSize/

2:0;h=Math.round(g.x1-
f);k=d&&0<d.length?Math.round(d[0]?d[0].lineCoordinates.y2:g.y1<Math.max(C,10)?Math.
max(C,10):g.y1):g.y1<Math.max(C,10)?Math.max(C,10):g.y1;l=Math.round(g.x2-V-
L);m=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:g.y2-O>n.height-
Math.max(C,10)?n.height-Math.max(C,10):g.y2-O):g.y2>n.height-
Math.max(C,10)?n.height-
Math.max(C,10):g.y2;if(b&&0<b.length)for(C=0;C<b.length;C++)b[C]&&b[C].labelAutoFit
&&(l=0>b[C].labelAngle?Math.max(l,u):0===b[e].labelAngle?Math.max(l,u/2):l,h=

0>b[C].labelAngle||0===b[C].labelAngle?l-
V:h);if(d&&0<d.length)for(C=0;C<d.length;C++)d[C]&&d[C].labelAutoFit&&(l=d[C].line
Coordinates.x2,h=l-V);c[e].lineCoordinates={x1:l+P,y1:k,x2:l+P,y2:m,height:Math.abs(m-
k)};c[e].bounds={x1:h,y1:k,x2:l,y2:m,width:l-h,height:m-
k};c[e].title&&(c[e]._titleTextBlock.maxWidth=0<c[e].titleMaxWidth&&c[e].titleMaxWidt
h<c[e].lineCoordinates.height?c[e].titleMaxWidth:c[e].lineCoordinates.height);c[e].calculate
ValueToPixelConversionParameters();P+=q[e]+c[e].margin}if(b&&

0<b.length)for(e=0;e<b.length;e++)b[e].calculateValueToPixelConversionParameters();if(d&
&0<d.length)for(e=0;e<d.length;e++)d[e].calculateValueToPixelConversionParameters();if(0
<r){if(a&&0<a.length)for(e=0;e<a.length;e++)E=I[r-1][e]===I[r][e]?!0:!1;else
E=!0;if(c&&0<c.length)for(e=0;e<c.length;e++)F=M[r-1][e]===M[r][e]?!0:!1;else
F=!0;if(b&&0<b.length)for(e=0;e<b.length;e++)G=s[r-1][e]===s[r][e]?!0:!1;else

189
Chatbot designing

G=!0;if(d&&0<d.length)for(e=0;e<d.length;e++)J=H[r-1][e]===H[r][e]?!0:!1;else
J=!0}if(E&&F&&

G&&J)break;r++}if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderLabelsTicksAndTitl
e();if(d&&0<d.length)for(e=0;e<d.length;e++)d[e].renderLabelsTicksAndTitle();if(a&&0<a.l
ength)for(e=0;e<a.length;e++)a[e].renderLabelsTicksAndTitle();if(c&&0<c.length)for(e=0;e
<c.length;e++)c[e].renderLabelsTicksAndTitle()}n.preparePlotArea();g=n.plotArea;p.save();
p.beginPath();p.rect(g.x1,g.y1,Math.abs(g.x2-g.x1),Math.abs(g.y2-
g.y1));p.clip();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].renderStripLinesOfThicknessT
ype("value");

if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderStripLinesOfThicknessType("value");if
(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderStripLinesOfThicknessType("value");if(
d&&0<d.length)for(e=0;e<d.length;e++)d[e].renderStripLinesOfThicknessType("value");if(a
&&0<a.length)for(e=0;e<a.length;e++)a[e].renderInterlacedColors();if(c&&0<c.length)for(e
=0;e<c.length;e++)c[e].renderInterlacedColors();if(b&&0<b.length)for(e=0;e<b.length;e++)b
[e].renderInterlacedColors();if(d&&0<d.length)for(e=0;e<d.length;e++)d[e].renderInterlaced
Colors();

p.restore();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].renderGrid();if(c&&0<c.length)for
(e=0;e<c.length;e++)c[e].renderGrid();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].render
Grid();if(d&&0<d.length)for(e=0;e<d.length;e++)d[e].renderGrid();if(a&&0<a.length)for(e=
0;e<a.length;e++)a[e].renderAxisLine();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].rende
rAxisLine();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderAxisLine();if(d&&0<d.len
gth)for(e=0;e<d.length;e++)d[e].renderAxisLine();if(a&&0<a.length)for(e=

0;e<a.length;e++)a[e].renderStripLinesOfThicknessType("pixel");if(c&&0<c.length)for(e=0;
e<c.length;e++)c[e].renderStripLinesOfThicknessType("pixel");if(b&&0<b.length)for(e=0;e
<b.length;e++)b[e].renderStripLinesOfThicknessType("pixel");if(d&&0<d.length)for(e=0;e<
d.length;e++)d[e].renderStripLinesOfThicknessType("pixel")};B.prototype.renderLabelsTick
sAndTitle=function(){var
a=!1,c=0,b=0,d=1,f=0;0!==this.labelAngle&&360!==this.labelAngle&&(d=1.2);if("undefine
d"===typeof this.options.interval){if("bottom"===

this._position||"top"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.l
abelAutoFit){for(var

190
Chatbot designing

c=[],d=0!==this.labelAngle&&360!==this.labelAngle?1:1.2,g,h=this.viewportMaximum,k=t
his.lineCoordinates.width/Math.log(this.range),l=this._labels.length-1;0<=l;l--
){n=this._labels[l];if(n.position<this.viewportMinimum)break;n.position>this.viewportMaxi
mum||!(l===this._labels.length-
1||g<Math.log(h/n.position)*k/d)||(c.push(n),h=n.position,g=n.textBlock.width*Math.abs(Mat
h.cos(Math.PI/

180*this.labelAngle))+n.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle))
)}this._labels=c}else{for(l=0;l<this._labels.length;l++)n=this._labels[l],n.position<this.viewp
ortMinimum||(n=n.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+n.tex
tBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)),c+=n);c>this.lineCoordinat
es.width*d&&this.labelAutoFit&&(a=!0)}if("left"===this._position||"right"===this._positio
n)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var c=

[],m,h=this.viewportMaximum,k=this.lineCoordinates.height/Math.log(this.range),l=this._lab
els.length-1;0<=l;l--
){n=this._labels[l];if(n.position<this.viewportMinimum)break;n.position>this.viewportMaxi
mum||!(l===this._labels.length-
1||m<Math.log(h/n.position)*k)||(c.push(n),h=n.position,m=n.textBlock.height*Math.abs(Mat
h.cos(Math.PI/180*this.labelAngle))+n.textBlock.width*Math.abs(Math.sin(Math.PI/180*thi
s.labelAngle)))}this._labels=c}else{for(l=0;l<this._labels.length;l++)n=this._labels[l],n.positi
on<

this.viewportMinimum||(n=n.textBlock.height*Math.abs(Math.cos(Math.PI/180*this.labelAn
gle))+n.textBlock.width*Math.abs(Math.sin(Math.PI/180*this.labelAngle)),b+=n);b>this.line
Coordinates.height*d&&this.labelAutoFit&&(a=!0)}}if("bottom"===this._position){for(var
n,l=0;l<this._labels.length;l++)n=this._labels[l],n.position<this.viewportMinimum||n.position
>this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n.position),a&&0!==f++%2&
&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,

this.ctx.strokeStyle=this.tickColor,d=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0,this.ct
x.beginPath(),this.ctx.moveTo(d,b.y<<0),this.ctx.lineTo(d,b.y+this.tickLength<<0),this.ctx.st
roke()),0===n.textBlock.angle?(b.x-
=n.textBlock.width/2,b.y+=this.tickLength+n.textBlock.fontSize/2):(b.x-
=0>this.labelAngle?n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,b.y+=this.ti

191
Chatbot designing

ckLength+Math.abs(0>this.labelAngle?n.textBlock.width*Math.sin(Math.PI/180*this.labelA
ngle)-5:5)),n.textBlock.x=b.x,n.textBlock.y=

b.y,n.textBlock.render(!0)));this.title&&(this._titleTextBlock.measureText(),this._titleTextBl
ock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-
this._titleTextBlock.width/2,this._titleTextBlock.y=this.bounds.y2-
this._titleTextBlock.height-
3,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else
if("top"===this._position){for(l=0;l<this._labels.length;l++)n=this._labels[l],n.position<this.
viewportMinimum||n.position>this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n
.position),

a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThi
ckness,this.ctx.strokeStyle=this.tickColor,d=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0
,this.ctx.beginPath(),this.ctx.moveTo(d,b.y<<0),this.ctx.lineTo(d,b.y-
this.tickLength<<0),this.ctx.stroke()),0===n.textBlock.angle?(b.x-=n.textBlock.width/2,b.y-
=this.tickLength+n.textBlock.height/2):(b.x+=(n.textBlock.height-this.tickLength-
this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-
(0<this.labelAngle?n.textBlock.width*

Math.cos(Math.PI/180*this.labelAngle):0),b.y-
=this.tickLength+(n.textBlock.height/2*Math.cos(Math.PI/180*this.labelAngle)+(0<this.labe
lAngle?n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0))),n.textBlock.x=b.x,n.te
xtBlock.y=b.y,n.textBlock.render(!0)));this.title&&(this._titleTextBlock.measureText(),this._
titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-
this._titleTextBlock.width/2,this._titleTextBlock.y=this.bounds.y1+1,this.titleMaxWidth=this
._titleTextBlock.maxWidth,

this._titleTextBlock.render(!0))}else
if("left"===this._position){for(l=0;l<this._labels.length;l++)n=this._labels[l],n.position<this.
viewportMinimum||n.position>this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n
.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=th
is.tickThickness,this.ctx.strokeStyle=this.tickColor,d=1===this.ctx.lineWidth%2?(b.y<<0)+0
.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,d),this.ctx.lineTo(b.x-
this.tickLength<<0,d),this.ctx.stroke()),

192
Chatbot designing

0===this.labelAngle?(n.textBlock.y=b.y,n.textBlock.x=b.x-
n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-
5):(n.textBlock.y=b.y-
n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),n.textBlock.x=0<this.labelAngle?
b.x-n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:b.x-
n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(n.textBlock.height-
n.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)-
this.tickLength),n.textBlock.render(!0)));

this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.bounds.x1+1,this.
_titleTextBlock.y=this.lineCoordinates.height/2+this._titleTextBlock.width/2+this.lineCoordi
nates.y1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}
else
if("right"===this._position){for(l=0;l<this._labels.length;l++)n=this._labels[l],n.position<this
.viewportMinimum||n.position>this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(
n.position),a&&0!==f++%2&&this.labelAutoFit||

(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickCol
or,d=1===this.ctx.lineWidth%2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b
.x<<0,d),this.ctx.lineTo(b.x+this.tickLength<<0,d),this.ctx.stroke()),0===this.labelAngle?(n.t
extBlock.y=b.y,n.textBlock.x=b.x+this.tickLength+5):(n.textBlock.y=0>this.labelAngle?b.y:
b.y-(n.textBlock.height-n.textBlock.fontSize/2-
5)*Math.cos(Math.PI/180*this.labelAngle),n.textBlock.x=0<this.labelAngle?b.x+(n.textBloc
k.height-

n.textBlock.fontSize/2-
5)*Math.sin(Math.PI/180*this.labelAngle)+this.tickLength:b.x+this.tickLength+5),n.textBlo
ck.render(!0)));this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.b
ounds.x2-1,this._titleTextBlock.y=this.lineCoordinates.height/2-
this._titleTextBlock.width/2+this.lineCoordinates.y1,this.titleMaxWidth=this._titleTextBlock
.maxWidth,this._titleTextBlock.render(!0))}};B.prototype.renderInterlacedColors=function()
{var a=this.chart.plotArea.ctx,c,b,d=this.chart.plotArea,

f=0;c=!0;if(("bottom"===this._position||"top"===this._position)&&this.interlacedColor)for(a
.fillStyle=this.interlacedColor,f=0;f<this._labels.length;f++)c?(c=this.getPixelCoordinatesOn
Axis(this._labels[f].position),b=f+1>this._labels.length-

193
Chatbot designing

1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(
this._labels[f+1].position),a.fillRect(Math.min(b.x,c.x),d.y1,Math.abs(b.x-
c.x),Math.abs(d.y1-d.y2)),c=!1):c=!0;else
if(("left"===this._position||"right"===this._position)&&this.interlacedColor)for(a.fillStyle=

this.interlacedColor,f=0;f<this._labels.length;f++)c?(b=this.getPixelCoordinatesOnAxis(this.
_labels[f].position),c=f+1>this._labels.length-
1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(
this._labels[f+1].position),a.fillRect(d.x1,Math.min(b.y,c.y),Math.abs(d.x1-
d.x2),Math.abs(c.y-
b.y)),c=!1):c=!0;a.beginPath()};B.prototype.renderStripLinesOfThicknessType=function(a){i
f(this.stripLines&&0<this.stripLines.length&&a){for(var
c=this,b,d=0,f=0,g=!1,h=!1,k=[],l=[],

h=!1,d=0;d<this.stripLines.length;d++){var
m=this.stripLines[d];m._thicknessType===a&&("pixel"===a&&(m.value<this.viewportMini
mum||m.value>this.viewportMaximum||x(m.value)||isNaN(this.range))||k.push(m))}for(d=0;d
<this._stripLineLabels.length;d++)if(m=this.stripLines[d],b=this._stripLineLabels[d],!(b.posi
tion<this.viewportMinimum||b.position>this.viewportMaximum||isNaN(this.range))){a=this.
getPixelCoordinatesOnAxis(b.position);if("outside"===b.stripLine.labelPlacement)if(m&&(t
his.ctx.strokeStyle=

m.color,"pixel"===m._thicknessType&&(this.ctx.lineWidth=m.thickness)),"bottom"===this.
_position){var
n=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0;this.ctx.beginPath();this.ctx.moveTo(n,a.
y<<0);this.ctx.lineTo(n,a.y+this.tickLength<<0);this.ctx.stroke();0===this.labelAngle?(a.x-
=b.textBlock.width/2,a.y+=this.tickLength+b.textBlock.fontSize/2):(a.x-
=0>this.labelAngle?b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,a.y+=this.ti
ckLength+Math.abs(0>this.labelAngle?b.textBlock.width*Math.sin(Math.PI/

180*this.labelAngle)-
5:5))}else"top"===this._position?(n=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,this.ct
x.beginPath(),this.ctx.moveTo(n,a.y<<0),this.ctx.lineTo(n,a.y-
this.tickLength<<0),this.ctx.stroke(),0===this.labelAngle?(a.x-=b.textBlock.width/2,a.y-
=this.tickLength+b.textBlock.height):(a.x+=(b.textBlock.height-this.tickLength-
this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-

194
Chatbot designing

(0<this.labelAngle?b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),a.y-
=this.tickLength+(b.textBlock.height*

Math.cos(Math.PI/180*this.labelAngle)+(0<this.labelAngle?b.textBlock.width*Math.sin(Mat
h.PI/180*this.labelAngle):0)))):"left"===this._position?(n=1===this.ctx.lineWidth%2?(a.y<<
0)+0.5:a.y<<0,this.ctx.beginPath(),this.ctx.moveTo(a.x<<0,n),this.ctx.lineTo(a.x-
this.tickLength<<0,n),this.ctx.stroke(),0===this.labelAngle?a.x=a.x-
b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:(a.y-
=b.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),a.x=0<this.labelAngle?a.x-
b.textBlock.width*

Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:a.x-
b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(b.textBlock.height-
b.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)-
this.tickLength)):"right"===this._position&&(n=1===this.ctx.lineWidth%2?(a.y<<0)+0.5:a.
y<<0,this.ctx.beginPath(),this.ctx.moveTo(a.x<<0,n),this.ctx.lineTo(a.x+this.tickLength<<0,
n),this.ctx.stroke(),0===this.labelAngle?a.x=a.x+this.tickLength+5:(a.y=0>this.labelAngle?a.
y:a.y-(b.textBlock.height-b.textBlock.fontSize/

2-5)*Math.cos(Math.PI/180*this.labelAngle),a.x=0<this.labelAngle?a.x+(b.textBlock.height-
b.textBlock.fontSize/2-
5)*Math.sin(Math.PI/180*this.labelAngle)+this.tickLength:a.x+this.tickLength+5));else
b.textBlock.angle=-
90,"bottom"===this._position?(b.textBlock.maxWidth=this.options.stripLines[d].labelMaxW
idth?this.options.stripLines[d].labelMaxWidth:this.chart.plotArea.height-
3,b.textBlock.measureText(),a.x-
b.textBlock.height>this.chart.plotArea.x1?x(m.startValue)?a.x-=b.textBlock.height-
b.textBlock.fontSize/

2:a.x-=b.textBlock.height/2-
b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(m.startValue)?a.x+=b.textBlock.height-
b.textBlock.fontSize/2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-
90===b.textBlock.angle?"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-
3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlo
ck.width)/2:this.chart.plotArea.y1+b.textBlock.width+3:"near"===b.stripLine.labelAlign?this
.chart.plotArea.y2-b.textBlock.width-3:"center"===

195
Chatbot designing

b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-
b.textBlock.width)/2:this.chart.plotArea.y1+3):"top"===this._position?(b.textBlock.maxWidt
h=this.options.stripLines[d].labelMaxWidth?this.options.stripLines[d].labelMaxWidth:this.ch
art.plotArea.height-3,b.textBlock.measureText(),a.x-
b.textBlock.height>this.chart.plotArea.x1?x(m.startValue)?a.x-=b.textBlock.height-
b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-
b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(m.startValue)?a.x+=

b.textBlock.height-b.textBlock.fontSize/2:a.x+=b.textBlock.height/2-
b.textBlock.fontSize/2+3),a.y=-
90===b.textBlock.angle?"near"===b.stripLine.labelAlign?this.chart.plotArea.y1+b.textBlock
.width+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b
.textBlock.width)/2:this.chart.plotArea.y2-
3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y1+3:"center"===b.stripLine.labelAlig
n?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y2-

b.textBlock.width-
3):"left"===this._position?(b.textBlock.maxWidth=this.options.stripLines[d].labelMaxWidth
?this.options.stripLines[d].labelMaxWidth:this.chart.plotArea.width-
3,b.textBlock.angle=0,b.textBlock.measureText(),a.y-
b.textBlock.height>this.chart.plotArea.y1?x(m.startValue)?a.y-=b.textBlock.height-
b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize+3:a.y-
b.textBlock.height<this.chart.plotArea.y2?a.y+=b.textBlock.fontSize/2+3:x(m.startValue)?a.
y-=b.textBlock.height-b.textBlock.fontSize/

2:a.y-=b.textBlock.height/2-
b.textBlock.fontSize+3,a.x="near"===b.stripLine.labelAlign?this.chart.plotArea.x1+3:"cente
r"===b.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/2-
b.textBlock.width/2:this.chart.plotArea.x2-b.textBlock.width-
3):"right"===this._position&&(b.textBlock.maxWidth=this.options.stripLines[d].labelMaxW
idth?this.options.stripLines[d].labelMaxWidth:this.chart.plotArea.width-
3,b.textBlock.angle=0,b.textBlock.measureText(),a.y-
+b.textBlock.height>this.chart.plotArea.y1?

x(m.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-
b.textBlock.fontSize/2-3:a.y-

196
Chatbot designing

b.textBlock.height<this.chart.plotArea.y2?a.y+=b.textBlock.fontSize/2+3:x(m.startValue)?a.
y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-
b.textBlock.fontSize/2+3,a.x="near"===b.stripLine.labelAlign?this.chart.plotArea.x2-
b.textBlock.width-
3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/2-
b.textBlock.width/2:this.chart.plotArea.x1+

3);b.textBlock.x=a.x;b.textBlock.y=a.y;l.push(b)}if(!h){h=!1;this.ctx.save();this.ctx.beginPat
h();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.ch
art.plotArea.height);this.ctx.clip();for(d=0;d<k.length;d++)m=k[d],m.showOnTop?g||(g=!0,th
is.chart.addEventListener("dataAnimationIterationEnd",function(){this.ctx.save();this.ctx.beg
inPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,th
is.chart.plotArea.height);this.ctx.clip();

for(f=0;f<k.length;f++)m=k[f],m.showOnTop&&m.render();this.ctx.restore()},m)):m.render(
);for(d=0;d<l.length;d++)b=l[d],b.stripLine.showOnTop?h||(h=!0,this.chart.addEventListener
("dataAnimationIterationEnd",function(){for(f=0;f<l.length;f++)b=l[f],"inside"===b.stripLin
e.labelPlacement&&b.stripLine.showOnTop&&(c.ctx.save(),c.ctx.beginPath(),c.ctx.rect(c.ch
art.plotArea.x1,c.chart.plotArea.y1,c.chart.plotArea.width,c.chart.plotArea.height),c.ctx.clip()
,b.textBlock.render(!0),c.ctx.restore())},b.textBlock)):

"inside"===b.stripLine.labelPlacement&&b.textBlock.render(!0);this.ctx.restore();h=!0}if(h)
for(h=!1,d=0;d<l.length;d++)b=l[d],b.stripLine.showOnTop?h||(h=!0,this.chart.addEventList
ener("dataAnimationIterationEnd",function(){for(f=0;f<l.length;f++)b=l[f],"outside"===b.str
ipLine.labelPlacement&&b.stripLine.showOnTop&&b.textBlock.render(!0)},b.textBlock)):"
outside"===b.stripLine.labelPlacement&&b.textBlock.render(!0)}};B.prototype.renderGrid=
function(){if(this.gridThickness&&0<this.gridThickness){var a=

this.chart.ctx;a.save();var
c,b=this.chart.plotArea;a.lineWidth=this.gridThickness;a.strokeStyle=this.gridColor;a.setLin
eDash&&a.setLineDash(I(this.gridDashType,this.gridThickness));if("bottom"===this._positi
on||"top"===this._position)for(d=0;d<this._labels.length;d++)this._labels[d].position<this.vie
wportMinimum||this._labels[d].position>this.viewportMaximum||(a.beginPath(),c=this.getPix
elCoordinatesOnAxis(this._labels[d].position),c=1===a.lineWidth%2?(c.x<<0)+0.5:c.x<<0,a
.moveTo(c,b.y1<<0),a.lineTo(c,

197
Chatbot designing

b.y2<<0),a.stroke());else if("left"===this._position||"right"===this._position)for(var
d=0;d<this._labels.length;d++)this._labels[d].position<this.viewportMinimum||this._labels[d]
.position>this.viewportMaximum||(a.beginPath(),c=this.getPixelCoordinatesOnAxis(this._lab
els[d].position),c=1===a.lineWidth%2?(c.y<<0)+0.5:c.y<<0,a.moveTo(b.x1<<0,c),a.lineTo(
b.x2<<0,c),a.stroke());a.restore()}};B.prototype.renderAxisLine=function(){var
a=this.chart.ctx;a.save();if("bottom"===this._position||"top"===this._position){if(this.lineThi
ckness){a.lineWidth=

this.lineThickness;a.strokeStyle=this.lineColor?this.lineColor:"black";a.setLineDash&&a.set
LineDash(I(this.lineDashType,this.lineThickness));var
c=1===this.lineThickness%2?(this.lineCoordinates.y1<<0)+0.5:this.lineCoordinates.y1<<0;a
.beginPath();a.moveTo(this.lineCoordinates.x1,c);a.lineTo(this.lineCoordinates.x2,c);a.stroke
()}}else"left"!==this._position&&"right"!==this._position||!this.lineThickness||(a.lineWidth=t
his.lineThickness,a.strokeStyle=this.lineColor,a.setLineDash&&a.setLineDash(I(this.lineDas
hType,

this.lineThickness)),c=1===this.lineThickness%2?(this.lineCoordinates.x1<<0)+0.5:this.line
Coordinates.x1<<0,a.beginPath(),a.moveTo(c,this.lineCoordinates.y1),a.lineTo(c,this.lineCo
ordinates.y2),a.stroke());a.restore()};B.prototype.getPixelCoordinatesOnAxis=function(a){va
r
c={};if("bottom"===this._position||"top"===this._position)c.x=this.convertValueToPixel(a),
c.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)c.y=this.conv
ertValueToPixel(a),c.x=this.lineCoordinates.x2;

return c};B.prototype.convertPixelToValue=function(a){if("undefined"===typeof a)return


null;var c=0,c=0,c="number"===typeof
a?a:"left"===this._position||"right"===this._position?a.y:a.x;return
c=this.logarithmic?Math.pow(this.logarithmBase,(c-
this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit)*this.viewport
Minimum:this.conversionParameters.minimum+(c-
this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit};B.prototype.c
onvertValueToPixel=function(a){return this.logarithmic?

this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*Math.log(a/this
.conversionParameters.minimum)/this.conversionParameters.lnLogarithmBase+0.5<<0:this.c
onversionParameters.reference+this.conversionParameters.pixelPerUnit*(a-

198
Chatbot designing

this.conversionParameters.minimum)+0.5<<0};B.prototype.setViewPortRange=function(a,c)
{this.sessionVariables.newViewportMinimum=this.viewportMinimum=Math.min(a,c);this.se
ssionVariables.newViewportMaximum=this.viewportMaximum=Math.max(a,c)};B.prototyp
e.getXValueAt=

function(a){if(!a)return null;var
c=null;"left"===this._position?c=this.convertPixelToValue(a.y):"bottom"===this._position&
&(c=this.convertPixelToValue(a.x));return
c};B.prototype.calculateValueToPixelConversionParameters=function(a){a={pixelPerUnit:n
ull,minimum:null,reference:null};var
c=this.lineCoordinates.width,b=this.lineCoordinates.height;a.minimum=this.viewportMinimu
m;if("bottom"===this._position||"top"===this._position)this.logarithmic?(a.lnLogarithmBase
=Math.log(this.logarithmBase),a.pixelPerUnit=

(this.reversed?-
1:1)*c*a.lnLogarithmBase/Math.log(Math.abs(this.range))):a.pixelPerUnit=(this.reversed?-
1:1)*c/Math.abs(this.range),a.reference=this.reversed?this.lineCoordinates.x2:this.lineCoordi
nates.x1;if("left"===this._position||"right"===this._position)this.logarithmic?(a.lnLogarithm
Base=Math.log(this.logarithmBase),a.pixelPerUnit=(this.reversed?1:-
1)*b*a.lnLogarithmBase/Math.log(Math.abs(this.range))):a.pixelPerUnit=(this.reversed?1:-
1)*b/Math.abs(this.range),a.reference=this.reversed?this.lineCoordinates.y1:

this.lineCoordinates.y2;this.conversionParameters=a};B.prototype.calculateAxisParameters=
function(){if(this.logarithmic)this.calculateLogarithamicAxisParameters();else{var
a=this.chart.layoutManager.getFreeSpace(),c=!1,b=!1;"bottom"===this._position||"top"===th
is._position?(this.maxWidth=a.width,this.maxHeight=a.height):(this.maxWidth=a.height,this.
maxHeight=a.width);var
a="axisX"===this.type?"xySwapped"===this.chart.plotInfo.axisPlacement?62:70:"xySwapp
ed"===this.chart.plotInfo.axisPlacement?50:

40,d=4;"axisX"===this.type&&(d=600>this.maxWidth?8:6);var
a=Math.max(d,Math.floor(this.maxWidth/a)),f,g,h,d=0;if(null===this.viewportMinimum||isN
aN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(null===this.viewportM
aximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;if("axisX"=
==this.type){if(this.dataSeries&&0<this.dataSeries.length)for(f=0;f<this.dataSeries.length;f+

199
Chatbot designing

+)"dateTime"===this.dataSeries[f].xValueType&&(b=!0);f=null!==this.viewportMinimum?t
his.viewportMinimum:

this.dataInfo.viewPortMin;g=null!==this.viewportMaximum?this.viewportMaximum:this.dat
aInfo.viewPortMax;0===g-f&&(d="undefined"===typeof
this.options.interval?0.4:this.options.interval,g+=d,f-
=d);Infinity!==this.dataInfo.minDiff?h=this.dataInfo.minDiff:1<g-f?h=0.5*Math.abs(g-
f):(h=1,b&&(c=!0))}else"axisY"===this.type&&(f=null!==this.viewportMinimum?this.view
portMinimum:this.dataInfo.viewPortMin,g=null!==this.viewportMaximum?this.viewportMa
ximum:this.dataInfo.viewPortMax,isFinite(f)||isFinite(g)?isFinite(f)?

isFinite(g)||(g=f):f=g:(g="undefined"===typeof this.options.interval?-
Infinity:this.options.interval,f=0),0===f&&0===g?(g+=9,f=0):0===g-
f?(d=Math.min(Math.abs(0.01*Math.abs(g)),5),g+=d,f-
=d):f>g?(d=Math.min(Math.abs(0.01*Math.abs(g-f)),5),0<=g?f=g-
d:g=f+d):(d=Math.min(Math.abs(0.01*Math.abs(g-f)),0.05),0!==g&&(g+=d),0!==f&&(f-
=d)),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<g-f?0.5*Math.abs(g-
f):1,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&
0<f&&(f=

0),this.includeZero&&(null===this.viewportMaximum||isNaN(this.viewportMaximum))&&0
>g&&(g=0));d=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?g:this.view
portMaximum)-
(isNaN(this.viewportMinimum)||null===this.viewportMinimum?f:this.viewportMinimum);if(
"axisX"===this.type&&b){this.intervalType||(d/1<=a?(this.interval=1,this.intervalType="mil
lisecond"):d/2<=a?(this.interval=2,this.intervalType="millisecond"):d/5<=a?(this.interval=5,t
his.intervalType="millisecond"):d/10<=a?(this.interval=10,

this.intervalType="millisecond"):d/20<=a?(this.interval=20,this.intervalType="millisecond")
:d/50<=a?(this.interval=50,this.intervalType="millisecond"):d/100<=a?(this.interval=100,this
.intervalType="millisecond"):d/200<=a?(this.interval=200,this.intervalType="millisecond"):
d/250<=a?(this.interval=250,this.intervalType="millisecond"):d/300<=a?(this.interval=300,t
his.intervalType="millisecond"):d/400<=a?(this.interval=400,this.intervalType="millisecond
"):d/500<=a?(this.interval=500,this.intervalType=

200
Chatbot designing

"millisecond"):d/(1*E.secondDuration)<=a?(this.interval=1,this.intervalType="second"):d/(2
*E.secondDuration)<=a?(this.interval=2,this.intervalType="second"):d/(5*E.secondDuration
)<=a?(this.interval=5,this.intervalType="second"):d/(10*E.secondDuration)<=a?(this.interval
=10,this.intervalType="second"):d/(15*E.secondDuration)<=a?(this.interval=15,this.interval
Type="second"):d/(20*E.secondDuration)<=a?(this.interval=20,this.intervalType="second"):
d/(30*E.secondDuration)<=a?(this.interval=30,this.intervalType=

"second"):d/(1*E.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):d/(2*E.m
inuteDuration)<=a?(this.interval=2,this.intervalType="minute"):d/(5*E.minuteDuration)<=a?
(this.interval=5,this.intervalType="minute"):d/(10*E.minuteDuration)<=a?(this.interval=10,t
his.intervalType="minute"):d/(15*E.minuteDuration)<=a?(this.interval=15,this.intervalType
="minute"):d/(20*E.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):d/(30
*E.minuteDuration)<=a?(this.interval=30,this.intervalType=

"minute"):d/(1*E.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):d/(2*E.hourD
uration)<=a?(this.interval=2,this.intervalType="hour"):d/(3*E.hourDuration)<=a?(this.interv
al=3,this.intervalType="hour"):d/(6*E.hourDuration)<=a?(this.interval=6,this.intervalType="
hour"):d/(1*E.dayDuration)<=a?(this.interval=1,this.intervalType="day"):d/(2*E.dayDuratio
n)<=a?(this.interval=2,this.intervalType="day"):d/(4*E.dayDuration)<=a?(this.interval=4,thi
s.intervalType="day"):d/(1*E.weekDuration)<=a?(this.interval=

1,this.intervalType="week"):d/(2*E.weekDuration)<=a?(this.interval=2,this.intervalType="w
eek"):d/(3*E.weekDuration)<=a?(this.interval=3,this.intervalType="week"):d/(1*E.monthDu
ration)<=a?(this.interval=1,this.intervalType="month"):d/(2*E.monthDuration)<=a?(this.inte
rval=2,this.intervalType="month"):d/(3*E.monthDuration)<=a?(this.interval=3,this.intervalT
ype="month"):d/(6*E.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.i
nterval=d/(1*E.yearDuration)<=a?1:d/(2*E.yearDuration)<=

a?2:d/(4*E.yearDuration)<=a?4:Math.floor(B.getNiceNumber(d/(a-
1),!0)/E.yearDuration),this.intervalType="year"));if(null===this.viewportMinimum||isNaN(th
is.viewportMinimum))this.viewportMinimum=f-
h/2;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximu
m=g+h/2;c?this.autoValueFormatString="MMM DD YYYY
HH:mm":"year"===this.intervalType?this.autoValueFormatString="YYYY":"month"===thi
s.intervalType?this.autoValueFormatString="MMM
YYYY":"week"===this.intervalType?this.autoValueFormatString=

201
Chatbot designing

"MMM DD YYYY":"day"===this.intervalType?this.autoValueFormatString="MMM DD
YYYY":"hour"===this.intervalType?this.autoValueFormatString="hh:mm
TT":"minute"===this.intervalType?this.autoValueFormatString="hh:mm
TT":"second"===this.intervalType?this.autoValueFormatString="hh:mm:ss
TT":"millisecond"===this.intervalType&&(this.autoValueFormatString="fff'ms'");this.value
FormatString||(this.valueFormatString=this.autoValueFormatString)}else{this.intervalType="
number";d=B.getNiceNumber(d,!1);this.interval=

this.options&&0<this.options.interval?this.options.interval:B.getNiceNumber(d/(a-
1),!0);if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinim
um="axisX"===this.type?f-
h/2:Math.floor(f/this.interval)*this.interval;if(null===this.viewportMaximum||isNaN(this.vie
wportMaximum))this.viewportMaximum="axisX"===this.type?g+h/2:Math.ceil(g/this.interv
al)*this.interval;0===this.viewportMaximum&&0===this.viewportMinimum&&(0===this.o
ptions.viewportMinimum?this.viewportMaximum+=10:0===this.options.viewportMaximum
&&

(this.viewportMinimum-=10),this.options&&"undefined"===typeof
this.options.interval&&(this.interval=B.getNiceNumber((this.viewportMaximum-
this.viewportMinimum)/(a-
1),!0)))}if(null===this.minimum||null===this.maximum)if("axisX"===this.type?(f=null!==th
is.minimum?this.minimum:this.dataInfo.min,g=null!==this.maximum?this.maximum:this.dat
aInfo.max,0===g-f&&(d="undefined"===typeof
this.options.interval?0.4:this.options.interval,g+=d,f-
=d),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<g-f?

0.5*Math.abs(g-
f):1):"axisY"===this.type&&(f=null!==this.minimum?this.minimum:this.dataInfo.min,g=nul
l!==this.maximum?this.maximum:this.dataInfo.max,isFinite(f)||isFinite(g)?0===f&&0===g?
(g+=9,f=0):0===g-f?(d=Math.min(Math.abs(0.01*Math.abs(g)),5),g+=d,f-
=d):f>g?(d=Math.min(Math.abs(0.01*Math.abs(g-f)),5),0<=g?f=g-
d:g=f+d):(d=Math.min(Math.abs(0.01*Math.abs(g-f)),0.05),0!==g&&(g+=d),0!==f&&(f-
=d)):(g="undefined"===typeof this.options.interval?-
Infinity:this.options.interval,f=0),h=Infinity!==this.dataInfo.minDiff?

202
Chatbot designing

this.dataInfo.minDiff:1<g-f?0.5*Math.abs(g-
f):1,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&0<f&&(f=0),this.i
ncludeZero&&(null===this.maximum||isNaN(this.maximum))&&0>g&&(g=0)),"axisX"===
this.type&&b){if(null===this.minimum||isNaN(this.minimum))this.minimum=f-
h/2;if(null===this.maximum||isNaN(this.maximum))this.maximum=g+h/2}else
this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?f
-h/2:Math.floor(f/this.interval)*this.interval,this.minimum=Math.min(this.minimum,

null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMini
mum)?Infinity:this.sessionVariables.viewportMinimum)),null===this.maximum&&(this.max
imum="axisX"===this.type?g+h/2:Math.ceil(g/this.interval)*this.interval,this.maximum=Ma
th.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionV
ariables.viewportMaximum)?-
Infinity:this.sessionVariables.viewportMaximum)),0===this.maximum&&0===this.minimu
m&&(0===this.options.minimum?this.maximum+=10:0===

this.options.maximum&&(this.minimum-
=10));this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum);this.viewpor
tMaximum=Math.min(this.viewportMaximum,this.maximum);this.range=this.viewportMaxi
mum-
this.viewportMinimum;this.intervalStartPosition="axisX"===this.type&&b?this.getLabelStar
tPoint(new
Date(this.viewportMinimum),this.intervalType,this.interval):Math.floor((this.viewportMinim
um+0.2*this.interval)/this.interval)*this.interval;if(!this.valueFormatString&&(this.valueFor
matString="#,##0.##",

1>this.range)){c=Math.floor(Math.abs(Math.log(this.range)/Math.LN10))+2;if(isNaN(c)||!isF
inite(c))c=2;if(2<c)for(b=0;b<c-
2;b++)this.valueFormatString+="#"}}};B.prototype.calculateLogarithamicAxisParameters=f
unction(){var
a=this.chart.layoutManager.getFreeSpace(),c=Math.log(this.logarithmBase),b;"bottom"===th
is._position||"top"===this._position?(this.maxWidth=a.width,this.maxHeight=a.height):(this.
maxWidth=a.height,this.maxHeight=a.width);var
a="axisX"===this.type?500>this.maxWidth?7:Math.max(7,Math.floor(this.maxWidth/

203
Chatbot designing

100)):Math.max(Math.floor(this.maxWidth/50),3),d,f,g,h;h=1;if(null===this.viewportMinim
um||isNaN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(null===this.vie
wportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;"axi
sX"===this.type?(d=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.vie
wPortMin,f=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortM
ax,1===f/d&&(h=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval?

0.4:this.options.interval),f*=h,d/=h),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff
:f/d>this.logarithmBase?f/d*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"=
==this.type&&(d=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewP
ortMin,f=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,
0>=d&&!isFinite(f)?(f="undefined"===typeof
this.options.interval?0:this.options.interval,d=1):0>=d?d=f:isFinite(f)||(f=d),1===d&&1===f
?(f*=this.logarithmBase-

1/this.logarithmBase,d=1):1===f/d?(h=Math.min(f*Math.pow(this.logarithmBase,0.01),Math
.pow(this.logarithmBase,5)),f*=h,d/=h):d>f?(h=Math.min(d/f*Math.pow(this.logarithmBase,
0.01),Math.pow(this.logarithmBase,5)),1<=f?d=f/h:f=d*h):(h=Math.min(f/d*Math.pow(this.l
ogarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==f&&(f*=h),1!==d&&(d/=h)),g
=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/d>this.logarithmBase?f/d*Math.po
w(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===

this.viewportMinimum||isNaN(this.viewportMinimum))&&1<d&&(d=1),this.includeZero&
&(null===this.viewportMaximum||isNaN(this.viewportMaximum))&&1>f&&(f=1));h=(isNa
N(this.viewportMaximum)||null===this.viewportMaximum?f:this.viewportMaximum)/(isNa
N(this.viewportMinimum)||null===this.viewportMinimum?d:this.viewportMinimum);linearR
ange=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?f:this.viewportMaxi
mum)-
(isNaN(this.viewportMinimum)||null===this.viewportMinimum?d:this.viewportMinimum);th
is.intervalType=

"number";h=Math.pow(this.logarithmBase,B.getNiceNumber(Math.abs(Math.log(h)/c),!1));t
his.options&&0<this.options.interval?this.interval=this.options.interval:(this.interval=B.getN
iceExponent(Math.log(h)/c/(a-1),!0),b=B.getNiceNumber(linearRange/(a-
1),!0));if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinim
um="axisX"===this.type?d/Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.flo

204
Chatbot designing

or(Math.log(d)/c/this.interval));if(null===this.viewportMaximum||isNaN(this.viewportMaxi
mum))this.viewportMaximum=

"axisX"===this.type?f*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(M
ath.log(f)/c/this.interval));1===this.viewportMaximum&&1===this.viewportMinimum&&(1
===this.options.viewportMinimum?this.viewportMaximum*=this.logarithmBase-
1/this.logarithmBase:1===this.options.viewportMaximum&&(this.viewportMinimum/=this.l
ogarithmBase-1/this.logarithmBase),this.options&&"undefined"===typeof
this.options.interval&&(this.interval=B.getNiceExponent(Math.ceil(Math.log(h)/c)/(a-
1)),b=B.getNiceNumber((this.viewportMaximum-

this.viewportMinimum)/(a-
1),!0)));if(null===this.minimum||null===this.maximum)"axisX"===this.type?(d=null!==this.
minimum?this.minimum:this.dataInfo.min,f=null!==this.maximum?this.maximum:this.dataIn
fo.max,1===f/d&&(h=Math.pow(this.logarithmBase,"undefined"===typeof
this.options.interval?0.4:this.options.interval),f*=h,d/=h),g=Infinity!==this.dataInfo.minDiff?
this.dataInfo.minDiff:f/d>this.logarithmBase?f/d*Math.pow(this.logarithmBase,0.5):this.loga
rithmBase):"axisY"===this.type&&(d=null!==this.minimum?

this.minimum:this.dataInfo.min,f=null!==this.maximum?this.maximum:this.dataInfo.max,isF
inite(d)||isFinite(f)?1===d&&1===f?(f*=this.logarithmBase,d/=this.logarithmBase):1===f/d
?(h=Math.pow(this.logarithmBase,this.interval),f*=h,d/=h):d>f?(h=Math.min(0.01*(d/f),5),1
<=f?d=f/h:f=d*h):(h=Math.min(f/d*Math.pow(this.logarithmBase,0.01),Math.pow(this.logari
thmBase,0.04)),1!==f&&(f*=h),1!==d&&(d/=h)):(f="undefined"===typeof
this.options.interval?0:this.options.interval,d=1),g=Infinity!==this.dataInfo.minDiff?

this.dataInfo.minDiff:f/d>this.logarithmBase?f/d*Math.pow(this.logarithmBase,0.5):this.loga
rithmBase,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&1<d&&(d=
1),this.includeZero&&(null===this.maximum||isNaN(this.maximum))&&1>f&&(f=1)),this.i
ntervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?d/Mat
h.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(d)/c/this.interval)),t
his.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||

isNaN(this.sessionVariables.viewportMinimum)?"undefined"===typeof
this.sessionVariables.newViewportMinimum?Infinity:this.sessionVariables.newViewportMin
imum:this.sessionVariables.viewportMinimum)),null===this.maximum&&(this.maximum="

205
Chatbot designing

axisX"===this.type?f*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Ma
th.log(f)/c/this.interval)),this.maximum=Math.max(this.maximum,null===this.sessionVariabl
es.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?"undefined"===type
of this.sessionVariables.newViewportMaximum?

0:this.sessionVariables.newViewportMaximum:this.sessionVariables.viewportMaximum)),1
===this.maximum&&1===this.minimum&&(1===this.options.minimum?this.maximum*=t
his.logarithmBase-
1/this.logarithmBase:1===this.options.maximum&&(this.minimum/=this.logarithmBase-
1/this.logarithmBase));this.viewportMinimum=Math.max(this.viewportMinimum,this.minim
um);this.viewportMaximum=Math.min(this.viewportMaximum,this.maximum);this.viewport
Minimum>this.viewportMaximum&&(!this.options.viewportMinimum&&!this.options.mini
mum||

this.options.viewportMaximum||this.options.maximum?this.options.viewportMinimum||this.o
ptions.minimum||!this.options.viewportMaximum&&!this.options.maximum||(this.viewport
Minimum=this.minimum=(this.options.viewportMaximum||this.options.maximum)/Math.po
w(this.logarithmBase,2*Math.ceil(this.interval))):this.viewportMaximum=this.maximum=thi
s.options.viewportMinimum||this.options.minimum);d=Math.pow(this.logarithmBase,Math.fl
oor(Math.log(this.viewportMinimum)/(c*this.interval)+0.2)*this.interval);this.range=

this.viewportMaximum/this.viewportMinimum;this.noTicks=a;if(!this.options.interval&&thi
s.range<Math.pow(this.logarithmBase,8>this.viewportMaximum||3>a?2:3)){for(c=Math.floo
r(this.viewportMinimum/b+0.5)*b;c<this.viewportMinimum;)c+=b;this.equidistantInterval=!
1;this.intervalStartPosition=c;this.interval=b}else
this.options.interval||(b=Math.ceil(this.interval),this.range>this.interval&&(this.interval=b,d=
Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(c*this.interval)+
0.2)*this.interval))),

this.equidistantInterval=!0,this.intervalStartPosition=d;if(!this.valueFormatString&&(this.val
ueFormatString="#,##0.##",1>this.viewportMinimum)){c=Math.floor(Math.abs(Math.log(thi
s.viewportMinimum)/Math.LN10))+2;if(isNaN(c)||!isFinite(c))c=2;if(2<c)for(b=0;b<c-
2;b++)this.valueFormatString+="#"}};B.getNiceExponent=function(a,c){var
b=Math.floor(Math.log(a)/Math.LN10),d=a/Math.pow(10,b),d=0>b?1>=d?1:5>=d?5:10:Mat
h.max(Math.floor(d),1);return
Number((d*Math.pow(10,b)).toFixed(20))};B.getNiceNumber=function(a,

206
Chatbot designing

c){var b=Math.floor(Math.log(a)/Math.LN10),d=a/Math.pow(10,b);return
Number(((c?1.5>d?1:3>d?2:7>d?5:10:1>=d?1:2>=d?2:5>=d?5:10)*Math.pow(10,b)).toFixed
(20))};B.prototype.getLabelStartPoint=function(){var
a=E[this.intervalType+"Duration"]*this.interval,a=new
Date(Math.floor(this.viewportMinimum/a)*a);if("millisecond"!==this.intervalType)if("secon
d"===this.intervalType)0<a.getMilliseconds()&&(a.setSeconds(a.getSeconds()+1),a.setMilli
seconds(0));else if("minute"===this.intervalType){if(0<a.getSeconds()||

0<a.getMilliseconds())a.setMinutes(a.getMinutes()+1),a.setSeconds(0),a.setMilliseconds(0)}
else
if("hour"===this.intervalType){if(0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds()
)a.setHours(a.getHours()+1),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else
if("day"===this.intervalType){if(0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.ge
tMilliseconds())a.setDate(a.getDate()+1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.set
Milliseconds(0)}else if("week"===this.intervalType){if(0<

a.getDay()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setD
ate(a.getDate()+(7-
a.getDay())),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else
if("month"===this.intervalType){if(1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.get
Seconds()||0<a.getMilliseconds())a.setMonth(a.getMonth()+1),a.setDate(1),a.setHours(0),a.se
tMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else"year"===this.intervalType&&(0<a.get
Month()||1<a.getDate()||0<a.getHours()||

0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())&&(a.setFullYear(a.getFullYear()
+1),a.setMonth(0),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMillisecon
ds(0));return
a};U(oa,M);oa.prototype.createUserOptions=function(a){if("undefined"!==typeof
a||this.options._isPlaceholder){var
c=0;this.parent.options._isPlaceholder&&this.parent.createUserOptions();this.options._isPlac
eholder||(ra(this.parent.stripLines),c=this.parent.options.stripLines.indexOf(this.options));this
.options=

"undefined"===typeof
a?{}:a;this.parent.options.stripLines[c]=this.options}};oa.prototype.render=function(){this.ct
x.save();var

207
Chatbot designing

a=this.parent.getPixelCoordinatesOnAxis(this.value),c=Math.abs("pixel"===this._thicknessT
ype?this.thickness:this.parent.conversionParameters.pixelPerUnit*this.thickness);if(0<c){var
b=null===this.opacity?1:this.opacity;this.ctx.strokeStyle=this.color;this.ctx.beginPath();var
d=this.ctx.globalAlpha;this.ctx.globalAlpha=b;G(this.id);var
f,g,h,k;this.ctx.lineWidth=c;this.ctx.setLineDash&&

this.ctx.setLineDash(I(this.lineDashType,c));if("bottom"===this.parent._position||"top"===th
is.parent._position)f=g=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,h=this.chart.plotAre
a.y1,k=this.chart.plotArea.y2,this.bounds={x1:f-c/2,y1:h,x2:g+c/2,y2:k};else
if("left"===this.parent._position||"right"===this.parent._position)h=k=1===this.ctx.lineWidt
h%2?(a.y<<0)+0.5:a.y<<0,f=this.chart.plotArea.x1,g=this.chart.plotArea.x2,this.bounds={x1
:f,y1:h-c/2,x2:g,y2:k+c/2};this.ctx.moveTo(f,h);this.ctx.lineTo(g,

k);this.ctx.stroke();this.ctx.globalAlpha=d}this.ctx.restore()};U(S,M);S.prototype._initialize=
function(){if(this.enabled){this.container=document.createElement("div");this.container.setA
ttribute("class","canvasjs-chart-
tooltip");this.container.style.position="absolute";this.container.style.height="auto";this.contai
ner.style.boxShadow="1px 1px 2px 2px
rgba(0,0,0,0.1)";this.container.style.zIndex="1000";this.container.style.display="none";var
a;a='<div style=" width: auto;height: auto;min-width: 50px;';

a+="line-height: auto;";a+="margin: 0px 0px 0px 0px;";a+="padding: 5px;";a+="font-family:


Calibri, Arial, Georgia, serif;";a+="font-weight: normal;";a+="font-style:
"+(v?"italic;":"normal;");a+="font-size: 14px;";a+="color: #000000;";a+="text-shadow: 1px
1px 1px rgba(0, 0, 0, 0.1);";a+="text-align: left;";a+="border: 2px solid
gray;";a+=v?"background: rgba(255,255,255,.9);":"background:
rgb(255,255,255);";a+="text-indent: 0px;";a+="white-space: nowrap;";a+="border-radius:
5px;";a+="-moz-user-select:none;";

a+="-khtml-user-select: none;";a+="-webkit-user-select: none;";a+="-ms-user-select:


none;";a+="user-select: none;";v||(a+="filter: alpha(opacity = 90);",a+="filter:
progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=135,
Color='#666666');");a+='} "> Sample
Tooltip</div>';this.container.innerHTML=a;this.contentDiv=this.container.firstChild;this.con
tainer.style.borderRadius=this.contentDiv.style.borderRadius;this.chart._canvasJSContainer.a
ppendChild(this.container)}};S.prototype.mouseMoveHandler=

208
Chatbot designing

function(a,c){this._lastUpdated&&40>(new Date).getTime()-
this._lastUpdated||(this._lastUpdated=(new
Date).getTime(),this._updateToolTip(a,c))};S.prototype._updateToolTip=function(a,c,b){b="
undefined"===typeof
b?!0:b;this.container||this._initialize();this.enabled||this.hide();if(!this.chart.disableToolTip){if
("undefined"===typeof a||"undefined"===typeof
c){if(isNaN(this._prevX)||isNaN(this._prevY))return;a=this._prevX;c=this._prevY}else
this._prevX=a,this._prevY=c;var d=null,f=null,g=[],h=0;if(this.shared&&

this.enabled&&"none"!==this.chart.plotInfo.axisPlacement){if("xySwapped"===this.chart.pl
otInfo.axisPlacement){f=[];if(this.chart.axisX)for(var
k=0;k<this.chart.axisX.length;k++){for(var
h=this.chart.axisX[k].convertPixelToValue({y:c}),l=null,d=0;d<this.chart.axisX[k].dataSerie
s.length;d++)(l=this.chart.axisX[k].dataSeries[d].getDataPointAtX(h,b))&&0<=l.index&&(l.
dataSeries=this.chart.axisX[k].dataSeries[d],null!==l.dataPoint.y&&f.push(l));l=null}if(this.c
hart.axisX2)for(k=0;k<this.chart.axisX2.length;k++){h=

this.chart.axisX2[k].convertPixelToValue({y:c});l=null;for(d=0;d<this.chart.axisX2[k].dataS
eries.length;d++)(l=this.chart.axisX2[k].dataSeries[d].getDataPointAtX(h,b))&&0<=l.index
&&(l.dataSeries=this.chart.axisX2[k].dataSeries[d],null!==l.dataPoint.y&&f.push(l));l=null}
}else{f=[];if(this.chart.axisX)for(k=0;k<this.chart.axisX.length;k++)for(h=this.chart.axisX[k]
.convertPixelToValue({x:a}),l=null,d=0;d<this.chart.axisX[k].dataSeries.length;d++)(l=this.c
hart.axisX[k].dataSeries[d].getDataPointAtX(h,

b))&&0<=l.index&&(l.dataSeries=this.chart.axisX[k].dataSeries[d],null!==l.dataPoint.y&&f
.push(l));if(this.chart.axisX2)for(k=0;k<this.chart.axisX2.length;k++)for(h=this.chart.axisX2[
k].convertPixelToValue({x:a}),l=null,d=0;d<this.chart.axisX2[k].dataSeries.length;d++)(l=th
is.chart.axisX2[k].dataSeries[d].getDataPointAtX(h,b))&&0<=l.index&&(l.dataSeries=this.c
hart.axisX2[k].dataSeries[d],null!==l.dataPoint.y&&f.push(l))}if(0===f.length)return;f.sort(f
unction(a,b){return a.distance-b.distance});b=f[0];

for(d=0;d<f.length;d++)f[d].dataPoint.x.valueOf()===b.dataPoint.x.valueOf()&&g.push(f[d])
;f=null}else{if(l=this.chart.getDataPointAtXY(a,c,b))this.currentDataPointIndex=l.dataPointI
ndex,this.currentSeriesIndex=l.dataSeries.index;else
if(v)if(l=Ma(a,c,this.chart._eventManager.ghostCtx),0<l&&"undefined"!==typeof
this.chart._eventManager.objectMap[l]){l=this.chart._eventManager.objectMap[l];if("legendI

209
Chatbot designing

tem"===l.objectType)return;this.currentSeriesIndex=l.dataSeriesIndex;this.currentDataPointI
ndex=0<=

l.dataPointIndex?l.dataPointIndex:-1}else this.currentDataPointIndex=-1;else
this.currentDataPointIndex=-
1;if(0<=this.currentSeriesIndex){f=this.chart.data[this.currentSeriesIndex];l={};if(0<=this.cu
rrentDataPointIndex)d=f.dataPoints[this.currentDataPointIndex],l.dataSeries=f,l.dataPoint=d,
l.index=this.currentDataPointIndex,l.distance=Math.abs(d.x-
h);else{if(!this.enabled||"line"!==f.type&&"stepLine"!==f.type&&"spline"!==f.type&&"area
"!==f.type&&"stepArea"!==f.type&&"splineArea"!==f.type&&"stackedArea"!==

f.type&&"stackedArea100"!==f.type&&"rangeArea"!==f.type&&"rangeSplineArea"!==f.typ
e&&"candlestick"!==f.type&&"ohlc"!==f.type)return;h=f.axisX.convertPixelToValue({x:a})
;l=f.getDataPointAtX(h,b);l.dataSeries=f;this.currentDataPointIndex=l.index;d=l.dataPoint}if
(!x(l.dataPoint.y))if(l.dataSeries.axisY)if(0<l.dataPoint.y.length){for(d=b=0;d<l.dataPoint.y.l
ength;d++)l.dataPoint.y[d]<l.dataSeries.axisY.viewportMinimum?b--
:l.dataPoint.y[d]>l.dataSeries.axisY.viewportMaximum&&b++;b<l.dataPoint.y.length&&

b>-
l.dataPoint.y.length&&g.push(l)}else"column"===f.type||"bar"===f.type?0>l.dataPoint.y?0>
l.dataSeries.axisY.viewportMinimum&&l.dataSeries.axisY.viewportMaximum>=l.dataPoint.
y&&g.push(l):l.dataSeries.axisY.viewportMinimum<=l.dataPoint.y&&0<=l.dataSeries.axisY
.viewportMaximum&&g.push(l):"bubble"===f.type?(b=this.chart._eventManager.objectMap
[f.dataPointIds[l.index]].size/2,l.dataPoint.y>=l.dataSeries.axisY.viewportMinimum-
b&&l.dataPoint.y<=l.dataSeries.axisY.viewportMaximum+b&&g.push(l)):(0<=l.dataSeries.t
ype.indexOf("100")||

"stackedColumn"===f.type||"stackedBar"===f.type||l.dataPoint.y>=l.dataSeries.axisY.viewp
ortMinimum&&l.dataPoint.y<=l.dataSeries.axisY.viewportMaximum)&&g.push(l);else
g.push(l)}}if(0<g.length&&(this.highlightObjects(g),this.enabled))if(b="",b=this.getToolTipI
nnerHTML({entries:g}),null!==b){this.contentDiv.innerHTML=b;this.contentDiv.innerHTM
L=b;b=!1;"none"===this.container.style.display&&(b=!0,this.container.style.display="block"
);try{this.contentDiv.style.background=this.backgroundColor?this.backgroundColor:

v?"rgba(255,255,255,.9)":"rgb(255,255,255)",this.borderColor=this.contentDiv.style.borderR
ightColor=this.contentDiv.style.borderLeftColor=this.contentDiv.style.borderColor=this.opti

210
Chatbot designing

ons.borderColor?this.options.borderColor:g[0].dataPoint.color?g[0].dataPoint.color:g[0].data
Series.color?g[0].dataSeries.color:g[0].dataSeries._colorSet[g[0].index%g[0].dataSeries._col
orSet.length],this.contentDiv.style.borderWidth=this.borderThickness||0===this.borderThick
ness?this.borderThickness+"px":"2px",this.contentDiv.style.borderRadius=

this.cornerRadius||0===this.cornerRadius?this.cornerRadius+"px":"5px",this.container.style.
borderRadius=this.contentDiv.style.borderRadius,this.contentDiv.style.fontSize=this.fontSize
||0===this.fontSize?this.fontSize+"px":"14px",this.contentDiv.style.color=this.fontColor?this
.fontColor:"#000000",this.contentDiv.style.fontFamily=this.fontFamily?this.fontFamily:"Cali
bri, Arial, Georgia,
serif;",this.contentDiv.style.fontWeight=this.fontWeight?this.fontWeight:"normal",this.conte
ntDiv.style.fontStyle=

this.fontStyle?this.fontStyle:v?"italic":"normal"}catch(m){}"pie"===g[0].dataSeries.type||"d
oughnut"===g[0].dataSeries.type||"funnel"===g[0].dataSeries.type||"bar"===g[0].dataSeries.t
ype||"rangeBar"===g[0].dataSeries.type||"stackedBar"===g[0].dataSeries.type||"stackedBar1
00"===g[0].dataSeries.type?a=a-10-
this.container.clientWidth:(a=g[0].dataSeries.axisX.convertValueToPixel(g[0].dataPoint.x)-
this.container.clientWidth<<0,a-
=10);0>a&&(a+=this.container.clientWidth+20);a+this.container.clientWidth>

Math.max(this.chart.container.clientWidth,this.chart.width)&&(a=Math.max(0,Math.max(thi
s.chart.container.clientWidth,this.chart.width)-
this.container.clientWidth));a+="px";c=1!==g.length||this.shared||"line"!==g[0].dataSeries.ty
pe&&"stepLine"!==g[0].dataSeries.type&&"spline"!==g[0].dataSeries.type&&"area"!==g[0]
.dataSeries.type&&"stepArea"!==g[0].dataSeries.type&&"splineArea"!==g[0].dataSeries.typ
e?"bar"===g[0].dataSeries.type||"rangeBar"===g[0].dataSeries.type||"stackedBar"===g[0].da
taSeries.type||

"stackedBar100"===g[0].dataSeries.type?g[0].dataSeries.axisX.convertValueToPixel(g[0].da
taPoint.x):c:g[0].dataSeries.axisY.convertValueToPixel(g[0].dataPoint.y);c=-
c+10;0<c+this.container.clientHeight+5&&(c-=c+this.container.clientHeight+5-
0);this.container.style.left=a;this.container.style.bottom=c+"px";!this.animationEnabled||b?thi
s.disableAnimation():this.enableAnimation()}else
this.hide(!1)}};S.prototype.highlightObjects=function(a){var
c=this.chart.overlaidCanvasCtx;this.chart.resetOverlayedCanvas();

211
Chatbot designing

c.clearRect(0,0,this.chart.width,this.chart.height);c.save();var
b=this.chart.plotArea,d=0;c.beginPath();c.rect(b.x1,b.y1,b.x2-b.x1,b.y2-
b.y1);c.clip();for(b=0;b<a.length;b++){var
f=a[b];if((f=this.chart._eventManager.objectMap[f.dataSeries.dataPointIds[f.index]])&&f.obj
ectType&&"dataPoint"===f.objectType){var
d=this.chart.data[f.dataSeriesIndex],g=d.dataPoints[f.dataPointIndex],h=f.dataPointIndex;!1=
==g.highlightEnabled||!0!==d.highlightEnabled&&!0!==g.highlightEnabled||("line"===d.typ
e||"stepLine"===

d.type||"spline"===d.type||"scatter"===d.type||"area"===d.type||"stepArea"===d.type||"spline
Area"===d.type||"stackedArea"===d.type||"stackedArea100"===d.type||"rangeArea"===d.ty
pe||"rangeSplineArea"===d.type?(g=d.getMarkerProperties(h,f.x1,f.y1,this.chart.overlaidCan
vasCtx),g.size=Math.max(1.5*g.size<<0,10),g.borderColor=g.borderColor||"#FFFFFF",g.bor
derThickness=g.borderThickness||Math.ceil(0.1*g.size),P.drawMarkers([g]),"undefined"!==t
ypeof f.y2&&(g=d.getMarkerProperties(h,f.x1,f.y2,this.chart.overlaidCanvasCtx),

g.size=Math.max(1.5*g.size<<0,10),g.borderColor=g.borderColor||"#FFFFFF",g.borderThic
kness=g.borderThickness||Math.ceil(0.1*g.size),P.drawMarkers([g]))):"bubble"===d.type?(g
=d.getMarkerProperties(h,f.x1,f.y1,this.chart.overlaidCanvasCtx),g.size=f.size,g.color="whit
e",g.borderColor="white",c.globalAlpha=0.3,P.drawMarkers([g]),c.globalAlpha=1):"column
"===d.type||"stackedColumn"===d.type||"stackedColumn100"===d.type||"bar"===d.type||"ra
ngeBar"===d.type||"stackedBar"===d.type||"stackedBar100"===d.type||

"rangeColumn"===d.type?N(c,f.x1,f.y1,f.x2,f.y2,"white",0,null,!1,!1,!1,!1,0.3):"pie"===d.ty
pe||"doughnut"===d.type?Ha(c,f.center,f.radius,"white",d.type,f.startAngle,f.endAngle,0.3,f.p
ercentInnerRadius):"candlestick"===d.type?(c.globalAlpha=1,c.strokeStyle=f.color,c.lineWi
dth=2*f.borderThickness,d=0===c.lineWidth%2?0:0.5,c.beginPath(),c.moveTo(f.x3-
d,Math.min(f.y2,f.y3)),c.lineTo(f.x3-
d,Math.min(f.y1,f.y4)),c.stroke(),c.beginPath(),c.moveTo(f.x3-
d,Math.max(f.y1,f.y4)),c.lineTo(f.x3-d,Math.max(f.y2,

f.y3)),c.stroke(),N(c,f.x1,Math.min(f.y1,f.y4),f.x2,Math.max(f.y1,f.y4),"transparent",2*f.bord
erThickness,f.color,!1,!1,!1,!1),c.globalAlpha=1):"ohlc"===d.type&&(c.globalAlpha=1,c.str
okeStyle=f.color,c.lineWidth=2*f.borderThickness,d=0===c.lineWidth%2?0:0.5,c.beginPath
(),c.moveTo(f.x3-d,f.y2),c.lineTo(f.x3-
d,f.y3),c.stroke(),c.beginPath(),c.moveTo(f.x3,f.y1),c.lineTo(f.x1,f.y1),c.stroke(),c.beginPath

212
Chatbot designing

(),c.moveTo(f.x3,f.y4),c.lineTo(f.x2,f.y4),c.stroke(),c.globalAlpha=1))}}c.restore();c.globalA
lpha=

1;c.beginPath()};S.prototype.getToolTipInnerHTML=function(a){a=a.entries;for(var
c=null,b=null,d=null,f=0,g="",h=!0,k=0;k<a.length;k++)if(a[k].dataSeries.toolTipContent||a[
k].dataPoint.toolTipContent){h=!1;break}if(h&&(this.content&&"function"===typeof
this.content||this.contentFormatter))a={chart:this.chart,toolTip:this.options,entries:a},c=this.c
ontentFormatter?this.contentFormatter(a):this.content(a);else
if(this.shared&&"none"!==this.chart.plotInfo.axisPlacement){for(var
l=null,m="",k=0;k<a.length;k++)if(b=

a[k].dataSeries,d=a[k].dataPoint,f=a[k].index,g="",0===k&&(h&&!this.content)&&(this.cha
rt.axisX&&0<this.chart.axisX.length?m+="undefined"!==typeof
this.chart.axisX[0].labels[d.x]?this.chart.axisX[0].labels[d.x]:"{x}":this.chart.axisX2&&0<th
is.chart.axisX2.length&&(m+="undefined"!==typeof
this.chart.axisX2[0].labels[d.x]?this.chart.axisX2[0].labels[d.x]:"{x}"),m+="</br>",m=this.c
hart.replaceKeywordsWithValue(m,d,b,f)),null!==d.toolTipContent&&("undefined"!==typeo
f d.toolTipContent||null!==b.options.toolTipContent)){if("line"===

b.type||"stepLine"===b.type||"spline"===b.type||"area"===b.type||"stepArea"===b.type||"spli
neArea"===b.type||"column"===b.type||"bar"===b.type||"scatter"===b.type||"stackedColumn
"===b.type||"stackedColumn100"===b.type||"stackedBar"===b.type||"stackedBar100"===b.t
ype||"stackedArea"===b.type||"stackedArea100"===b.type)this.chart.axisX&&1<this.chart.a
xisX.length&&(g+=l!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<b
r/>":""),g+=d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:

this.content&&"function"!==typeof this.content?this.content:"<span
style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span>&nbsp;&nbsp;{
y}",l=b.axisXIndex;else
if("bubble"===b.type)this.chart.axisX&&1<this.chart.axisX.length&&(g+=l!=b.axisXIndex?
b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=d.toolTipContent?d.toolTi
pContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof
this.content?this.content:"<span style='\""+(this.options.fontColor?

"":"'color:{color};'")+"\"'>{name}:</span>&nbsp;&nbsp;{y}, &nbsp;&nbsp;{z}";else
if("rangeColumn"===b.type||"rangeBar"===b.type||"rangeArea"===b.type||"rangeSplineArea

213
Chatbot designing

"===b.type)this.chart.axisX&&1<this.chart.axisX.length&&(g+=l!=b.axisXIndex?b.axisX.tit
le?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=d.toolTipContent?d.toolTipContent:
b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof
this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+

"\"'>{name}:</span>&nbsp;&nbsp;{y[0]},&nbsp;{y[1]}";else
if("candlestick"===b.type||"ohlc"===b.type)this.chart.axisX&&1<this.chart.axisX.length&&
(g+=l!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=d.to
olTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function
"!==typeof this.content?this.content:"<span
style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span><br/>Open:
&nbsp;&nbsp;{y[0]}<br/>High:
&nbsp;&nbsp;&nbsp;{y[1]}<br/>Low:&nbsp;&nbsp;&nbsp;{y[2]}<br/>Close:
&nbsp;&nbsp;{y[3]}";

null===c&&(c="");!0===this.reversed?(c=this.chart.replaceKeywordsWithValue(g,d,b,f)+c,
k<a.length-
1&&(c="</br>"+c)):(c+=this.chart.replaceKeywordsWithValue(g,d,b,f),k<a.length-
1&&(c+="</br>"))}null!==c&&(c=m+c)}else{b=a[0].dataSeries;d=a[0].dataPoint;f=a[0].ind
ex;if(null===d.toolTipContent||"undefined"===typeof
d.toolTipContent&&null===b.options.toolTipContent)return
null;if("line"===b.type||"stepLine"===b.type||"spline"===b.type||"area"===b.type||"stepArea
"===b.type||"splineArea"===b.type||"column"===

b.type||"bar"===b.type||"scatter"===b.type||"stackedColumn"===b.type||"stackedColumn100
"===b.type||"stackedBar"===b.type||"stackedBar100"===b.type||"stackedArea"===b.type||"st
ackedArea100"===b.type)g=d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTip
Content:this.content&&"function"!==typeof this.content?this.content:"<span
style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(d.label?"{label}":"{x}")+":<
/span>&nbsp;&nbsp;{y}";else if("bubble"===b.type)g=d.toolTipContent?d.toolTipContent:

b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof
this.content?this.content:"<span
style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(d.label?"{label}":"{x}")+":<
/span>&nbsp;&nbsp;{y}, &nbsp;&nbsp;{z}";else
if("pie"===b.type||"doughnut"===b.type||"funnel"===b.type)g=d.toolTipContent?d.toolTipC

214
Chatbot designing

ontent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof
this.content?this.content:"<span
style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(d.name?

"{name}:</span>&nbsp;&nbsp;":d.label?"{label}:</span>&nbsp;&nbsp;":"</span>")+"{y}"
;else
if("rangeColumn"===b.type||"rangeBar"===b.type||"rangeArea"===b.type||"rangeSplineArea
"===b.type)g=d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:this.co
ntent&&"function"!==typeof this.content?this.content:"<span
style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(d.label?"{label}":"{x}")+"
:</span>&nbsp;&nbsp;{y[0]}, &nbsp;{y[1]}";else
if("candlestick"===b.type||"ohlc"===b.type)g=

d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"funct
ion"!==typeof this.content?this.content:"<span
style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(d.label?"{label}":"{x}")+"</
span><br/>Open: &nbsp;&nbsp;{y[0]}<br/>High: &nbsp;&nbsp;&nbsp;{y[1]}<br/>Low:
&nbsp;&nbsp;&nbsp;&nbsp;{y[2]}<br/>Close:
&nbsp;&nbsp;{y[3]}";null===c&&(c="");c+=this.chart.replaceKeywordsWithValue(g,d,b,f)
}return c};S.prototype.enableAnimation=function(){this.container.style.WebkitTransition||

(this.container.style.WebkitTransition="left .2s ease-out, bottom .2s ease-


out",this.container.style.MozTransition="left .2s ease-out, bottom .2s ease-
out",this.container.style.MsTransition="left .2s ease-out, bottom .2s ease-
out",this.container.style.transition="left .2s ease-out, bottom .2s ease-
out")};S.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(th
is.container.style.WebkitTransition="",this.container.style.MozTransition="",this.container.st
yle.MsTransition="",

this.container.style.transition="")};S.prototype.hide=function(a){this.container&&(this.contai
ner.style.display="none",this.currentSeriesIndex=-
1,this._prevY=this._prevX=NaN,("undefined"===typeof
a||a)&&this.chart.resetOverlayedCanvas())};S.prototype.show=function(a,c,b){this._updateT
oolTip(a,c,"undefined"===typeof
b?!1:b)};A.prototype.getPercentAndTotal=function(a,c){var

215
Chatbot designing

b=null,d=null,f=null;if(0<=a.type.indexOf("stacked"))d=0,b=c.x.getTime?c.x.getTime():c.x,b
in a.plotUnit.yTotals&&(d=a.plotUnit.yTotals[b],

f=isNaN(c.y)?0:0===d?0:100*(c.y/d));else
if("pie"===a.type||"doughnut"===a.type){for(i=d=0;i<a.dataPoints.length;i++)isNaN(a.dataP
oints[i].y)||(d+=a.dataPoints[i].y);f=isNaN(c.y)?0:100*(c.y/d)}return{percent:f,total:d}};A.pr
ototype.replaceKeywordsWithValue=function(a,c,b,d,f){var g=this;f="undefined"===typeof
f?0:f;if((0<=b.type.indexOf("stacked")||"pie"===b.type||"doughnut"===b.type)&&(0<=a.inde
xOf("#percent")||0<=a.indexOf("#total"))){var
h="#percent",k="#total",l=this.getPercentAndTotal(b,c),k=

isNaN(l.total)?k:l.total,h=isNaN(l.percent)?h:l.percent;do{l="";if(b.percentFormatString)l=b.
percentFormatString;else{var
l="#,##0.",m=Math.max(Math.ceil(Math.log(1/Math.abs(h))/Math.LN10),2);if(isNaN(m)||!is
Finite(m))m=2;for(var
n=0;n<m;n++)l+="#";b.percentFormatString=l}a=a.replace("#percent",ca(h,l,g._cultureInfo))
;a=a.replace("#total",ca(k,b.yValueFormatString?b.yValueFormatString:"#,##0.########",g.
_cultureInfo))}while(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))}return
a.replace(/\{.*?\}|"[^"]*"|'[^']*'/g,

function(a){if('"'===a[0]&&'"'===a[a.length-1]||"'"===a[0]&&"'"===a[a.length-1])return
a.slice(1,a.length-1);a=la(a.slice(1,a.length-1));a=a.replace("#index",f);var e=null;try{var
h=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);h&&0<h.length&&(e=la(h[2]),a=la(h[1]))}catch(k){}h=n
ull;if("color"===a)return
c.color?c.color:b.color?b.color:b._colorSet[d%b._colorSet.length];if(c.hasOwnProperty(a))h=
c;else if(b.hasOwnProperty(a))h=b;else
return"";h=h[a];null!==e&&(h=h[e]);if("x"===a)if("dateTime"===g.plotInfo.axisXValueTyp
e||

"dateTime"===b.xValueType||c.x&&c.x.getTime){if(g.plotInfo.plotTypes[0].plotUnits[0].ax
isX&&!g.plotInfo.plotTypes[0].plotUnits[0].axisX.logarithmic)return
Fa(h,c.xValueFormatString?c.xValueFormatString:b.xValueFormatString?b.xValueFormatSt
ring:b.xValueFormatString=g.axisX&&g.axisX.autoValueFormatString?g.axisX.autoValueF
ormatString:"DD MMM YY",g._cultureInfo)}else return
ca(h,c.xValueFormatString?c.xValueFormatString:b.xValueFormatString?b.xValueFormatSt
ring:b.xValueFormatString="#,##0.########",

216
Chatbot designing

g._cultureInfo);else
return"y"===a?ca(h,c.yValueFormatString?c.yValueFormatString:b.yValueFormatString?b.y
ValueFormatString:b.yValueFormatString="#,##0.########",g._cultureInfo):"z"===a?ca(h,
c.zValueFormatString?c.zValueFormatString:b.zValueFormatString?b.zValueFormatString:b
.zValueFormatString="#,##0.########",g._cultureInfo):h})};ma.prototype.reset=function(){
this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscriptions=[];this.previ
ousDataPointEventObject=null;this.eventObjects=

[];v&&(this.ghostCtx.clearRect(0,0,this.chart.width,this.chart.height),this.ghostCtx.beginPath
())};ma.prototype.getNewObjectTrackingId=function(){return++this.lastObjectId};ma.protot
ype.mouseEventHandler=function(a){if("mousemove"===a.type||"click"===a.type){var
c=[],b=ya(a),d=null;if((d=this.chart.getObjectAtXY(b.x,b.y,!1))&&"undefined"!==typeof
this.objectMap[d])if(d=this.objectMap[d],"dataPoint"===d.objectType){var
f=this.chart.data[d.dataSeriesIndex],g=f.dataPoints[d.dataPointIndex],h=d.dataPointIndex;

d.eventParameter={x:b.x,y:b.y,dataPoint:g,dataSeries:f.options,dataPointIndex:h,dataSeriesIn
dex:f.index,chart:this.chart};d.eventContext={context:g,userContext:g,mouseover:"mouseove
r",mousemove:"mousemove",mouseout:"mouseout",click:"click"};c.push(d);d=this.objectMa
p[f.id];d.eventParameter={x:b.x,y:b.y,dataPoint:g,dataSeries:f.options,dataPointIndex:h,data
SeriesIndex:f.index,chart:this.chart};d.eventContext={context:f,userContext:f.options,mouse
over:"mouseover",mousemove:"mousemove",mouseout:"mouseout",

click:"click"};c.push(this.objectMap[f.id])}else"legendItem"===d.objectType&&(f=this.char
t.data[d.dataSeriesIndex],g=null!==d.dataPointIndex?f.dataPoints[d.dataPointIndex]:null,d.ev
entParameter={x:b.x,y:b.y,dataSeries:f.options,dataPoint:g,dataPointIndex:d.dataPointIndex,
dataSeriesIndex:d.dataSeriesIndex,chart:this.chart},d.eventContext={context:this.chart.legen
d,userContext:this.chart.legend.options,mouseover:"itemmouseover",mousemove:"itemmous
emove",mouseout:"itemmouseout",click:"itemclick"},c.push(d));

f=[];for(b=0;b<this.mouseoveredObjectMaps.length;b++){g=!0;for(d=0;d<c.length;d++)if(c[
d].id===this.mouseoveredObjectMaps[b].id){g=!1;break}g?this.fireEvent(this.mouseovered
ObjectMaps[b],"mouseout",a):f.push(this.mouseoveredObjectMaps[b])}this.mouseoveredObj
ectMaps=f;for(b=0;b<c.length;b++){f=!1;for(d=0;d<this.mouseoveredObjectMaps.length;d+
+)if(c[b].id===this.mouseoveredObjectMaps[d].id){f=!0;break}f||(this.fireEvent(c[b],"mouse
over",a),this.mouseoveredObjectMaps.push(c[b]));"click"===a.type?this.fireEvent(c[b],

217
Chatbot designing

"click",a):"mousemove"===a.type&&this.fireEvent(c[b],"mousemove",a)}}};ma.prototype.fi
reEvent=function(a,c,b){if(a&&c){var
d=a.eventParameter,f=a.eventContext,g=a.eventContext.userContext;g&&(f&&g[f[c]])&&g[
f[c]].call(g,d);"mouseout"!==c?g.cursor&&g.cursor!==b.target.style.cursor&&(b.target.style.
cursor=g.cursor):(b.target.style.cursor=this.chart._defaultCursor,delete
a.eventParameter,delete
a.eventContext);"click"===c&&("dataPoint"===a.objectType&&this.chart.pieDoughnutClic
kHandler)&&this.chart.pieDoughnutClickHandler.call(this.chart.data[a.dataSeriesIndex],

d)}};U(pa,M);Ea.prototype.animate=function(a,c,b,d,f){var
g=this;this.chart.isAnimating=!0;f=f||F.easing.linear;b&&this.animations.push({startTime:(n
ew
Date).getTime()+(a?a:0),duration:c,animationCallback:b,onComplete:d});for(a=[];0<this.ani
mations.length;)if(c=this.animations.shift(),b=(new
Date).getTime(),d=0,c.startTime<=b&&(d=f(Math.min(b-
c.startTime,c.duration),0,1,c.duration),d=Math.min(d,1),isNaN(d)||!isFinite(d))&&(d=1),1>d
&&a.push(c),c.animationCallback(d),1<=d&&c.onComplete)c.onComplete();

this.animations=a;0<this.animations.length?this.animationRequestId=this.chart.requestAnim
Frame.call(window,function(){g.animate.call(g)}):this.chart.isAnimating=!1};Ea.prototype.c
ancelAllAnimations=function(){this.animations=[];this.animationRequestId&&this.chart.can
celRequestAnimFrame.call(window,this.animationRequestId);this.animationRequestId=null;t
his.chart.isAnimating=!1};var F={yScaleAnimation:function(a,c){if(0!==a){var
b=c.dest,d=c.source.canvas,f=c.animationBase;b.drawImage(d,0,0,d.width,

d.height,0,f-
f*a,b.canvas.width/Q,a*b.canvas.height/Q)}},xScaleAnimation:function(a,c){if(0!==a){var
b=c.dest,d=c.source.canvas,f=c.animationBase;b.drawImage(d,0,0,d.width,d.height,f-
f*a,0,a*b.canvas.width/Q,b.canvas.height/Q)}},xClipAnimation:function(a,c){if(0!==a){var
b=c.dest,d=c.source.canvas;b.save();0<a&&b.drawImage(d,0,0,d.width*a,d.height,0,0,d.widt
h*a/Q,d.height/Q);b.restore()}},fadeInAnimation:function(a,c){if(0!==a){var
b=c.dest,d=c.source.canvas;b.save();b.globalAlpha=a;b.drawImage(d,

0,0,d.width,d.height,0,0,b.canvas.width/Q,b.canvas.height/Q);b.restore()}},easing:{linear:fun
ction(a,c,b,d){return b*a/d+c},easeOutQuad:function(a,c,b,d){return-b*(a/=d)*(a-
2)+c},easeOutQuart:function(a,c,b,d){return-b*((a=a/d-1)*a*a*a-

218
Chatbot designing

1)+c},easeInQuad:function(a,c,b,d){return
b*(a/=d)*a+c},easeInQuart:function(a,c,b,d){return
b*(a/=d)*a*a*a+c}}},P={drawMarker:function(a,c,b,d,f,g,h,k){if(b){var
l=1;b.fillStyle=g?g:"#000000";b.strokeStyle=h?h:"#000000";b.lineWidth=k?k:0;"circle"===
d?(b.moveTo(a,c),

b.beginPath(),b.arc(a,c,f/2,0,2*Math.PI,!1),g&&b.fill(),k&&(h?b.stroke():(l=b.globalAlpha,b
.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=l))):"square"===d?(b.begi
nPath(),b.rect(a-f/2,c-
f/2,f,f),g&&b.fill(),k&&(h?b.stroke():(l=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="bl
ack",b.stroke(),b.globalAlpha=l))):"triangle"===d?(b.beginPath(),b.moveTo(a-
f/2,c+f/2),b.lineTo(a+f/2,c+f/2),b.lineTo(a,c-
f/2),b.closePath(),g&&b.fill(),k&&(h?b.stroke():(l=b.globalAlpha,b.globalAlpha=0.15,

b.strokeStyle="black",b.stroke(),b.globalAlpha=l)),b.beginPath()):"cross"===d&&(b.strokeS
tyle=g,b.lineWidth=f/4,b.beginPath(),b.moveTo(a-f/2,c-
f/2),b.lineTo(a+f/2,c+f/2),b.stroke(),b.moveTo(a+f/2,c-f/2),b.lineTo(a-
f/2,c+f/2),b.stroke())}},drawMarkers:function(a){for(var c=0;c<a.length;c++){var
b=a[c];P.drawMarker(b.x,b.y,b.ctx,b.type,b.size,b.color,b.borderColor,b.borderThickness)}}}
,ka={Chart:A,addColorSet:function(a,c){ga[a]=c},addCultureInfo:function(a,c){qa[a]=c},for
matNumber:function(a,c,b){b=

b||"en";if(qa[b])return ca(a,c||"#,##0.##",new pa(b));throw"Unknown Culture


Name";},formatDate:function(a,c,b){b=b||"en";if(qa[b])return Fa(a,c||"DD MMM
YYYY",new pa(b));throw"Unknown Culture Name";}};ka.Chart.version="v1.9.8
GA";window.CanvasJS=ka})();

/*

excanvas is used to support IE678 which do not implement HTML5 Canvas Element. You
can safely remove the following excanvas code if you don't need to support older browsers.

Copyright 2006 Google Inc. https://code.google.com/p/explorercanvas/

Licensed under the Apache License, Version 2.0

219
Chatbot designing

*/

document.createElement("canvas").getContext||function(){function V(){return
this.context_||(this.context_=new C(this))}function W(a,b,c){var
g=M.call(arguments,2);return function(){return
a.apply(b,g.concat(M.call(arguments)))}}function N(a){return
String(a).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function
O(a){a.namespaces.g_vml_||a.namespaces.add("g_vml_","urn:schemas-microsoft-
com:vml","#default#VML");a.namespaces.g_o_||a.namespaces.add("g_o_","urn:schemas-
microsoft-com:office:office","#default#VML");

a.styleSheets.ex_canvas_||(a=a.createStyleSheet(),a.owningElement.id="ex_canvas_",a.cssTe
xt="canvas{display:inline-block;overflow:hidden;text-
align:left;width:300px;height:150px}")}function X(a){var
b=a.srcElement;switch(a.propertyName){case
"width":b.getContext().clearRect();b.style.width=b.attributes.width.nodeValue+"px";b.firstC
hild.style.width=b.clientWidth+"px";break;case
"height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.first
Child.style.height=b.clientHeight+

"px"}}function
Y(a){a=a.srcElement;a.firstChild&&(a.firstChild.style.width=a.clientWidth+"px",a.firstChild
.style.height=a.clientHeight+"px")}function D(){return[[1,0,0],[0,1,0],[0,0,1]]}function
t(a,b){for(var c=D(),g=0;3>g;g++)for(var e=0;3>e;e++){for(var
f=0,d=0;3>d;d++)f+=a[g][d]*b[d][e];c[g][e]=f}return c}function
P(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWi
dth;b.miterLimit=a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;
b.shadowOffsetX=

a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.globalA
lpha=a.globalAlpha;b.font=a.font;b.textAlign=a.textAlign;b.textBaseline=a.textBaseline;b.ar
cScaleX_=a.arcScaleX_;b.arcScaleY_=a.arcScaleY_;b.lineScale_=a.lineScale_}function
Q(a){var
b=a.indexOf("(",3),c=a.indexOf(")",b+1),b=a.substring(b+1,c).split(",");if(4!=b.length||"a"!=
a.charAt(3))b[3]=1;return b}function E(a,b,c){return Math.min(c,Math.max(b,a))}function
F(a,b,c){0>c&&c++;1<c&&c--;return 1>6*c?a+6*(b-a)*c:

220
Chatbot designing

1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function G(a){if(a in H)return H[a];var


b,c=1;a=String(a);if("#"==a.charAt(0))b=a;else if(/^rgb/.test(a)){c=Q(a);b="#";for(var
g,e=0;3>e;e++)g=-
1!=c[e].indexOf("%")?Math.floor(255*(parseFloat(c[e])/100)):+c[e],b+=v[E(g,0,255)];c=+c[
3]}else
if(/^hsl/.test(a)){e=c=Q(a);b=parseFloat(e[0])/360%360;0>b&&b++;g=E(parseFloat(e[1])/10
0,0,1);e=E(parseFloat(e[2])/100,0,1);if(0==g)g=e=b=e;else{var f=0.5>e?e*(1+g):e+g-
e*g,d=2*e-f;g=F(d,f,b+1/3);e=F(d,f,b);b=F(d,f,b-1/3)}b="#"+

v[Math.floor(255*g)]+v[Math.floor(255*e)]+v[Math.floor(255*b)];c=c[3]}else
b=Z[a]||a;return H[a]={color:b,alpha:c}}function
C(a){this.m_=D();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.stro
keStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=1
*q;this.globalAlpha=1;this.font="10px sans-
serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=a;var
b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolut
e",

c=a.ownerDocument.createElement("div");c.style.cssText=b;a.appendChild(c);b=c.cloneNod
e(!1);b.style.backgroundColor="red";b.style.filter="alpha(opacity=0)";a.appendChild(b);this.
element_=c;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function
R(a,b,c,g){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x
:g.x,y:g.y});a.currentX_=g.x;a.currentY_=g.y}function S(a,b){var
c=G(a.strokeStyle),g=c.color,c=c.alpha*a.globalAlpha,e=a.lineScale_*a.lineWidth;1>e&&(c
*=e);b.push("<g_vml_:stroke",

' opacity="',c,'"',' joinstyle="',a.lineJoin,'"',' miterlimit="',a.miterLimit,'"','


endcap="',$[a.lineCap]||"square",'"',' weight="',e,'px"',' color="',g,'" />')}function
T(a,b,c,g){var e=a.fillStyle,f=a.arcScaleX_,d=a.arcScaleY_,k=g.x-c.x,n=g.y-c.y;if(e
instanceof w){var h=0,l=g=0,u=0,m=1;if("gradient"==e.type_){h=e.x1_/f;c=e.y1_/d;var
p=s(a,e.x0_/f,e.y0_/d),h=s(a,h,c),h=180*Math.atan2(h.x-p.x,h.y-
p.y)/Math.PI;0>h&&(h+=360);1E-6>h&&(h=0)}else p=s(a,e.x0_,e.y0_),g=(p.x-
c.x)/k,l=(p.y-c.y)/n,k/=f*q,

n/=d*q,m=x.max(k,n),u=2*e.r0_/m,m=2*e.r1_/m-u;f=e.colors_;f.sort(function(a,b){return
a.offset-b.offset});d=f.length;p=f[0].color;c=f[d-1].color;k=f[0].alpha*a.globalAlpha;a=f[d-

221
Chatbot designing

1].alpha*a.globalAlpha;for(var n=[],r=0;r<d;r++){var t=f[r];n.push(t.offset*m+u+"


"+t.color)}b.push('<g_vml_:fill type="',e.type_,'"',' method="none" focus="100%"','
color="',p,'"',' color2="',c,'"',' colors="',n.join(","),'"',' opacity="',a,'"',' g_o_:opacity2="',k,'"','
angle="',h,'"',' focusposition="',g,",",l,'" />')}else e instanceof

I?k&&n&&b.push("<g_vml_:fill",' position="',-c.x/k*f*f,",",-c.y/n*d*d,'"',' type="tile"','


src="',e.src_,'" />'):(e=G(a.fillStyle),b.push('<g_vml_:fill color="',e.color,'"
opacity="',e.alpha*a.globalAlpha,'" />'))}function
s(a,b,c){a=a.m_;return{x:q*(b*a[0][0]+c*a[1][0]+a[2][0])-
r,y:q*(b*a[0][1]+c*a[1][1]+a[2][1])-r}}function
z(a,b,c){isFinite(b[0][0])&&(isFinite(b[0][1])&&isFinite(b[1][0])&&isFinite(b[1][1])&&isFi
nite(b[2][0])&&isFinite(b[2][1]))&&(a.m_=b,c&&(a.lineScale_=aa(ba(b[0][0]*b[1][1]-
b[0][1]*

b[1][0]))))}function
w(a){this.type_=a;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}f
unction I(a,b){if(!a||1!=a.nodeType||"IMG"!=a.tagName)throw new
A("TYPE_MISMATCH_ERR");if("complete"!=a.readyState)throw new
A("INVALID_STATE_ERR");switch(b){case "repeat":case null:case
"":this.repetition_="repeat";break;case "repeat-x":case "repeat-y":case "no-
repeat":this.repetition_=b;break;default:throw new
A("SYNTAX_ERR");}this.src_=a.src;this.width_=a.width;this.height_=a.height}

function A(a){this.code=this[a];this.message=a+": DOM Exception "+this.code}var


x=Math,k=x.round,J=x.sin,K=x.cos,ba=x.abs,aa=x.sqrt,q=10,r=q/2;navigator.userAgent.matc
h(/MSIE ([\d.]+)?/);var M=Array.prototype.slice;O(document);var
U={init:function(a){a=a||document;a.createElement("canvas");a.attachEvent("onreadystatech
ange",W(this.init_,this,a))},init_:function(a){a=a.getElementsByTagName("canvas");for(var
b=0;b<a.length;b++)this.initElement(a[b])},initElement:function(a){if(!a.getContext){a.getC
ontext=

V;O(a.ownerDocument);a.innerHTML="";a.attachEvent("onpropertychange",X);a.attachEve
nt("onresize",Y);var
b=a.attributes;b.width&&b.width.specified?a.style.width=b.width.nodeValue+"px":a.width=a
.clientWidth;b.height&&b.height.specified?a.style.height=b.height.nodeValue+"px":a.height
=a.clientHeight}return a}};U.init();for(var v=[],d=0;16>d;d++)for(var

222
Chatbot designing

B=0;16>B;B++)v[16*d+B]=d.toString(16)+B.toString(16);var
Z={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFF
F",beige:"#F5F5DC",

bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",br
own:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",choco
late:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"
#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8
860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB7
6B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:
"#9932CC",darkred:"#8B0000",

darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#
2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppin
k:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"
#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#
DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",
greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",i
ndigo:"#4B0082",

ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngre
en:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightc
yan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3
D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"
#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lig
htyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediuma
quamarine:"#66CDAA",

mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumsea
green:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumtur
quoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5F
FFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5
E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",pale
goldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB
7093",papayawhip:"#FFEFD5",

223
Chatbot designing

peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"
#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#F
A8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D
",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow
:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD
8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmok
e:"#F5F5F5",yellowgreen:"#9ACD32"},

H={},L={},$={butt:"flat",round:"round"},d=C.prototype;d.clearRect=function(){this.textMe
asureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null);this.element_.i
nnerHTML=""};d.beginPath=function(){this.currentPath_=[]};d.moveTo=function(a,b){var
c=s(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.cur
rentY_=c.y};d.lineTo=function(a,b){var
c=s(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.curre
ntY_=c.y};d.bezierCurveTo=

function(a,b,c,g,e,f){e=s(this,e,f);a=s(this,a,b);c=s(this,c,g);R(this,a,c,e)};d.quadraticCurveTo
=function(a,b,c,g){a=s(this,a,b);c=s(this,c,g);g={x:this.currentX_+2/3*(a.x-
this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)};R(this,g,{x:g.x+(c.x-
this.currentX_)/3,y:g.y+(c.y-this.currentY_)/3},c)};d.arc=function(a,b,c,g,e,f){c*=q;var
d=f?"at":"wa",k=a+K(g)*c-r,n=b+J(g)*c-r;g=a+K(e)*c-r;e=b+J(e)*c-
r;k!=g||f||(k+=0.125);a=s(this,a,b);k=s(this,k,n);g=s(this,g,e);this.currentPath_.push({type:d,

x:a.x,y:a.y,radius:c,xStart:k.x,yStart:k.y,xEnd:g.x,yEnd:g.y})};d.rect=function(a,b,c,g){this.
moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath()};d.st
rokeRect=function(a,b,c,g){var
e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g)
;this.lineTo(a,b+g);this.closePath();this.stroke();this.currentPath_=e};d.fillRect=function(a,b,
c,g){var
e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+

c,b+g);this.lineTo(a,b+g);this.closePath();this.fill();this.currentPath_=e};d.createLinearGradi
ent=function(a,b,c,g){var e=new w("gradient");e.x0_=a;e.y0_=b;e.x1_=c;e.y1_=g;return
e};d.createRadialGradient=function(a,b,c,g,e,f){var d=new
w("gradientradial");d.x0_=a;d.y0_=b;d.r0_=c;d.x1_=g;d.y1_=e;d.r1_=f;return
d};d.drawImage=function(a,b){var

224
Chatbot designing

c,g,e,d,r,y,n,h;e=a.runtimeStyle.width;d=a.runtimeStyle.height;a.runtimeStyle.width="auto";a
.runtimeStyle.height="auto";var l=a.width,u=a.height;a.runtimeStyle.width=

e;a.runtimeStyle.height=d;if(3==arguments.length)c=arguments[1],g=arguments[2],r=y=0,n=
e=l,h=d=u;else
if(5==arguments.length)c=arguments[1],g=arguments[2],e=arguments[3],d=arguments[4],r=
y=0,n=l,h=u;else
if(9==arguments.length)r=arguments[1],y=arguments[2],n=arguments[3],h=arguments[4],c=
arguments[5],g=arguments[6],e=arguments[7],d=arguments[8];else throw Error("Invalid
number of arguments");var m=s(this,c,g),p=[];p.push(" <g_vml_:group",'
coordsize="',10*q,",",10*q,'"',' coordorigin="0,0"',' style="width:',

10,"px;height:",10,"px;position:absolute;");if(1!=this.m_[0][0]||this.m_[0][1]||1!=this.m_[1][1
]||this.m_[1][0]){var
t=[];t.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M2
2=",this.m_[1][1],",","Dx=",k(m.x/q),",","Dy=",k(m.y/q),"");var
v=s(this,c+e,g),w=s(this,c,g+d);c=s(this,c+e,g+d);m.x=x.max(m.x,v.x,w.x,c.x);m.y=x.max(m
.y,v.y,w.y,c.y);p.push("padding:0 ",k(m.x/q),"px ",k(m.y/q),"px
0;filter:progid:DXImageTransform.Microsoft.Matrix(",t.join(""),",
sizingmethod='clip');")}else p.push("top:",

k(m.y/q),"px;left:",k(m.x/q),"px;");p.push(' ">','<g_vml_:image src="',a.src,'"','


style="width:',q*e,"px;"," height:",q*d,'px"',' cropleft="',r/l,'"',' croptop="',y/u,'"','
cropright="',(l-r-n)/l,'"',' cropbottom="',(u-y-h)/u,'"',"
/>","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",p.join(""))};d.stro
ke=function(a){var b=[];b.push("<g_vml_:shape",' filled="',!!a,'"','
style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0,0"','
coordsize="',10*q,",",10*q,'"',

' stroked="',!a,'"',' path="');for(var


c={x:null,y:null},d={x:null,y:null},e=0;e<this.currentPath_.length;e++){var
f=this.currentPath_[e];switch(f.type){case "moveTo":b.push(" m
",k(f.x),",",k(f.y));break;case "lineTo":b.push(" l ",k(f.x),",",k(f.y));break;case
"close":b.push(" x ");f=null;break;case "bezierCurveTo":b.push(" c
",k(f.cp1x),",",k(f.cp1y),",",k(f.cp2x),",",k(f.cp2y),",",k(f.x),",",k(f.y));break;case "at":case
"wa":b.push(" ",f.type," ",k(f.x-this.arcScaleX_*f.radius),",",k(f.y-this.arcScaleY_*

225
Chatbot designing

f.radius)," ",k(f.x+this.arcScaleX_*f.radius),",",k(f.y+this.arcScaleY_*f.radius),"
",k(f.xStart),",",k(f.yStart),"
",k(f.xEnd),",",k(f.yEnd))}if(f){if(null==c.x||f.x<c.x)c.x=f.x;if(null==d.x||f.x>d.x)d.x=f.x;if(n
ull==c.y||f.y<c.y)c.y=f.y;if(null==d.y||f.y>d.y)d.y=f.y}}b.push('
">');a?T(this,b,c,d):S(this,b);b.push("</g_vml_:shape>");this.element_.insertAdjacentHTML(
"beforeEnd",b.join(""))};d.fill=function(){this.stroke(!0)};d.closePath=function(){this.curren
tPath_.push({type:"close"})};d.save=function(){var a=

{};P(this,a);this.aStack_.push(a);this.mStack_.push(this.m_);this.m_=t(D(),this.m_)};d.restor
e=function(){this.aStack_.length&&(P(this.aStack_.pop(),this),this.m_=this.mStack_.pop())}
;d.translate=function(a,b){z(this,t([[1,0,0],[0,1,0],[a,b,1]],this.m_),!1)};d.rotate=function(a){v
ar b=K(a);a=J(a);z(this,t([[b,a,0],[-
a,b,0],[0,0,1]],this.m_),!1)};d.scale=function(a,b){this.arcScaleX_*=a;this.arcScaleY_*=b;z(t
his,t([[a,0,0],[0,b,0],[0,0,1]],this.m_),!0)};d.transform=function(a,b,c,d,e,f){z(this,t([[a,

b,0],[c,d,0],[e,f,1]],this.m_),!0)};d.setTransform=function(a,b,c,d,e,f){z(this,[[a,b,0],[c,d,0],[e
,f,1]],!0)};d.drawText_=function(a,b,c,d,e){var f=this.m_;d=0;var
r=1E3,t=0,n=[],h;h=this.font;if(L[h])h=L[h];else{var
l=document.createElement("div").style;try{l.font=h}catch(u){}h=L[h]={style:l.fontStyle||"no
rmal",variant:l.fontVariant||"normal",weight:l.fontWeight||"normal",size:l.fontSize||10,family:
l.fontFamily||"sans-serif"}}var l=h,m=this.element_;h={};for(var p in
l)h[p]=l[p];p=parseFloat(m.currentStyle.fontSize);

m=parseFloat(l.size);"number"==typeof l.size?h.size=l.size:-
1!=l.size.indexOf("px")?h.size=m:-1!=l.size.indexOf("em")?h.size=p*m:-
1!=l.size.indexOf("%")?h.size=p/100*m:-
1!=l.size.indexOf("pt")?h.size=m/0.75:h.size=p;h.size*=0.981;p=h.style+" "+h.variant+"
"+h.weight+" "+h.size+"px
"+h.family;m=this.element_.currentStyle;l=this.textAlign.toLowerCase();switch(l){case
"left":case "center":case "right":break;case
"end":l="ltr"==m.direction?"right":"left";break;case "start":l="rtl"==m.direction?"right":

"left";break;default:l="left"}switch(this.textBaseline){case "hanging":case
"top":t=h.size/1.75;break;case "middle":break;default:case null:case "alphabetic":case
"ideographic":case "bottom":t=-h.size/2.25}switch(l){case "right":d=1E3;r=0.05;break;case
"center":d=r=500}b=s(this,b+0,c+t);n.push('<g_vml_:line from="',-d,' 0" to="',r,' 0.05" ','

226
Chatbot designing

coordsize="100 100" coordorigin="0 0"',' filled="',!e,'" stroked="',!!e,'"


style="position:absolute;width:1px;height:1px;">');e?S(this,n):T(this,n,{x:-d,y:0},

{x:r,y:h.size});e=f[0][0].toFixed(3)+","+f[1][0].toFixed(3)+","+f[0][1].toFixed(3)+","+f[1][1
].toFixed(3)+",0,0";b=k(b.x/q)+","+k(b.y/q);n.push('<g_vml_:skew on="t" matrix="',e,'" ','
offset="',b,'" origin="',d,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath
on="true" string="',N(a),'" style="v-text-align:',l,";font:",N(p),'"
/></g_vml_:line>');this.element_.insertAdjacentHTML("beforeEnd",n.join(""))};d.fillText=f
unction(a,b,c,d){this.drawText_(a,b,c,d,!1)};d.strokeText=function(a,

b,c,d){this.drawText_(a,b,c,d,!0)};d.measureText=function(a){this.textMeasureEl_||(this.ele
ment_.insertAdjacentHTML("beforeEnd",'<span style="position:absolute;top:-
20000px;left:0;padding:0;margin:0;border:none;white-
space:pre;"></span>'),this.textMeasureEl_=this.element_.lastChild);var
b=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.st
yle.font=this.font;this.textMeasureEl_.appendChild(b.createTextNode(a));return{width:this.t
extMeasureEl_.offsetWidth}};d.clip=function(){};

d.arcTo=function(){};d.createPattern=function(a,b){return new
I(a,b)};w.prototype.addColorStop=function(a,b){b=G(b);this.colors_.push({offset:a,color:b.c
olor,alpha:b.alpha})};d=A.prototype=Error();d.INDEX_SIZE_ERR=1;d.DOMSTRING_SIZ
E_ERR=2;d.HIERARCHY_REQUEST_ERR=3;d.WRONG_DOCUMENT_ERR=4;d.INVA
LID_CHARACTER_ERR=5;d.NO_DATA_ALLOWED_ERR=6;d.NO_MODIFICATION_
ALLOWED_ERR=7;d.NOT_FOUND_ERR=8;d.NOT_SUPPORTED_ERR=9;d.INUSE_A
TTRIBUTE_ERR=10;d.INVALID_STATE_ERR=11;d.SYNTAX_ERR=12;d.INVALID_M
ODIFICATION_ERR=

13;d.NAMESPACE_ERR=14;d.INVALID_ACCESS_ERR=15;d.VALIDATION_ERR=16;
d.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=U;CanvasRenderingContext2D=C;
CanvasGradient=w;CanvasPattern=I;DOMException=A}();

227